Re:Faster than jQuery(document).ready() - Wait Until Exists
by Jencha on Monday July 25, 2011 @06:32AM
(#2802079)
"it's faster" - but where are the numbers?
[ Parent
| on HN ]
Re:Faster than jQuery(document).ready() - Wait Until Exists
by locci on Monday July 25, 2011 @07:57AM
(#2802262)
I think he meant faster as in executed before, rather than in executed faster.
Re:Faster than jQuery(document).ready() - Wait Until Exists
by julian37 on Monday July 25, 2011 @08:56AM
(#2802386)
Still doesn't answer the question: how much earlier is it executed? I would like to know.
Re:Faster than jQuery(document).ready() - Wait Until Exists
by locci on Monday July 25, 2011 @09:22AM
(#2802482)
actually, the script doesn't make any sense because it would be executed as soon as the browser is idling, that is after it has rendered the dom completely, that is when the DOMContentLoaded event fires.
The right way to run a script right after an element has been created is to place the script right after the element closing tag.
You still can use it for setting late binding event handlers though.