News for hackers. Stuff that matters.
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?
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.
Re:Stop Paying Your jQuery Tax by ehynds on Friday February 17, 2012 @08:21AM (#3603158)
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
Re:Stop Paying Your jQuery Tax by sams99 on Friday February 17, 2012 @06:01AM (#3602898)
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
Re:Stop Paying Your jQuery Tax by ehynds on Friday February 17, 2012 @08:11AM (#3603138)
If all your scripts are before the closing </body>, the DOM will be ready by the time they execute, and you can safely ditch your legacy ready wrappers.