@Dean, I wrote a post in your blog which apparently discarded it completely
... anyway, somehow you already answered cause you said you use a meta
rather than document.body or document.documentElement.
My concern was about generic slowdown performances like DOMAttrModified in
Gecko if applied to the main node.
@John, about broken execution, it could be the most important script in the
page (e.g. jQuery) as it could be a silly noob script for an alert if the
browser is "Atari rather than Trident" ... it is true that the site should
behave the same in any case but maybe that script was not that important ...
in few words: who knows? If the developer does not care about errors He
should not be able to make the entire page not usable, don't you agree?
At the same time if one of the options is
addEventListener("DOMContentLoaded") with Dean suggestion we could
"normalize" what happen with standard DOM events, which is in my opinion a
better normalization approach, rather than modify standard behaviors in
every compatible browser.
onContent = (function(delay, call){
setTimeout(function(){
if(document.body){
if(call = callbacks.shift()){
try {
call(); // if everything is ok
arguments.callee(); // re-call this function
} catch(e) {
// otherwise set the callback ASAP
setTimeout(arguments.callee, 1);
// and throw this error
throw e;
}
};
} else
setTimeout(arguments.callee, delay);
}, delay);
var callbacks = [];
return function(callback){
callbacks.push(callback);
};
})(15);
onContent(function(){
document.body.innerHTML += "1";
FAILURE++;
});
onContent(function(){
document.body.innerHTML += "2";
});
Above example code should act in order and withuot problems, the speed
execution is a problem only when there are errors and because of the delay,
so in the ideal scenario, the execution speed will be optimal, isn't it?
Finally, I think libraries should behave the same in every condition
otherwise the "write once run everywhere" concept become buggy and
meaningless (specially if it is simple to implement a standard behavior).
On Wed, Mar 25, 2009 at 1:48 PM, jdalton <[email protected]>wrote:
>
> * It effects IE 7 too (fixed in IE8)
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---