Faster than jQuery(document).ready() - Wait Until Exists
javascriptisawesome.blogspot.com
Faster than jQuery(document).ready() - Wait Until Exists
1–10 of 48 posts
Re: Faster than jQuery(document).ready() - Wait Until Exists
#2I'd like to know if there is any performance hit though, NodeInserted fires on basically on every single fraction of page creation.
Re: Faster than jQuery(document).ready() - Wait Until Exists
#3Re: Faster than jQuery(document).ready() - Wait Until Exists
#4Don't use 1.49mb large GIF animations as background images...
Re: Faster than jQuery(document).ready() - Wait Until Exists
#5* I could test it myself, but I expected to have in the article detailed information on the different possible states the document can have when my callback is called. The questions I know the answer when waiting for the whole document to be loaded : Is it half loaded ? What is the DOM state ? Is completely loaded ? If not, have the document JavaScript code been entirely ran ? and so on. This kind of question left unanswered often lead to hard bites.
* why using "itself" ? I would have used a "sensible default" : when no context is given, use the waited DOM object instead of an arbitrary value (document), and use something else when it is explicitly given. The "itself" thing should be left as an internal flag IMHO.
Re: Faster than jQuery(document).ready() - Wait Until Exists
#6You can do $(document).ready(), why not, the admittedly syntax sugared, $("div#main").ready().
Re: Faster than jQuery(document).ready() - Wait Until Exists
#7You know how you can accelerate your page even further? Don't use 1.49mb large GIF animations as background images...
Re: Faster than jQuery(document).ready() - Wait Until Exists
#8http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeI...
They have been deprecated because they perform poorly:
> Firefox, for example, when it realizes that a mutation event has been turned on, instantly goes into an incredibly-slow code path where it has to fire events at every single DOM modification. This means that doing something like .innerHTML = "foo" where it wipes out 1000 elements would fire, at least 1000 + 1 events (1000 removal events, 1 addition event).
http://lists.w3.org/Archives/Public/www-dom/2009AprJun/0072....
> Mutation Events are widely acknowledged as “slow” in terms of the real performance degradation that occurs on websites that use them heavily for tracking changes to the DOM
Re: Faster than jQuery(document).ready() - Wait Until Exists
#9DOMNodeInserted is deprecated in the DOM Level 3 Events recommendation, along with all the other mutation events: http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeI... They have been deprecated because they perform poorly: > Firefox, for example, when it realizes that a mutation event has been turned on, instantly goes into an incredibly-slow code path where it has to fire events at every single DOM modific…