3 ms·
Here's a good summary of what's great about .ready(): http://docs.jquery.com/Tutorials:Introducing_$%28document%29.ready%28%29 http://docs.jquery.com/Tutorials:
by mmuro 14y ago
Here's a good summary of what's great about .ready(): http://docs.jquery.com/Tutorials:Introducing_$%28document%29.ready%28%29 http://docs.jquery.com/Tutorials:Introducing_$%28document%29...
Basically, this is what makes it so great: Everything that you stick inside its brackets is ready to go at the earliest possible moment — as soon as the DOM is registered by the browser.
Waiting on the window is actually slower than waiting on the DOM.