Re:Stop Paying Your jQuery Tax
by Yahivin on Friday February 17, 2012 @04:24AM
(#3602748)
Why do you still need a document ready function if all your scripts are loading after the html anyway?
[ Parent
| on HN ]
Re:Stop Paying Your jQuery Tax
by beaumartinez on Friday February 17, 2012 @06:10AM
(#3602913)
The DOM will have been parsed if your scripts are at the end—but external components (links, imgs) may not have loaded yet.
The same is true whether or not you use a document.ready statement; you're thinking of window.onready, which fires once all images have been downloaded.
Re:Stop Paying Your jQuery Tax
by beaumartinez on Friday February 17, 2012 @08:36AM
(#3603196)
You are correct! Thanks. Been spending too long with document.readyState.
Re:Stop Paying Your jQuery Tax
by ricardobeat on Friday February 17, 2012 @02:57PM
(#3604741)
you meant window.onload
well its more of a legacy problem, we are used to using it everywhere, deferring external scripts is a fairly easy exercise but those tiny snippets everywhere that have $(doStuff) are more annoying to port