Can the jQuery Ready Event Actually Slow Page Load?

Posted by: Mike Girouard on 08/23/2010

An interesting post from Dave Ward came my way today which outlines a few conditions in which the jQuery Ready event my actually increase perceived load times.

…what if $document.ready is slowing you down? In this post, I’m going show you specific instances where postponing startup code until the document’s ready event slows perceived page load time, could leave your UI needlessly unresponsive, and even causes initialization code to run slower than necessary.

While I always do make a conscious decision to separate library and application code from my initialization methods, I’m starting to wonder if I should be paying more attention to applications similar to his examples.

Dave concludes that this certainly isn’t applicable in all situations. True, in fact, I’d say it’s always the safe bet to include your init routines in a ready event. When you get to the point where performance optimization matters, these are some great points to consider.

via Don’t let jQuery’s $document.ready slow you down | Encosia.

Share this post


About Mike Girouard

Mike Girouard

Mike Girouard is a web enthusiast based in NYC. He is a active presenter at conferences and user groups, and leads the development of several open source side projects. When he has time, he enjoys getting outside and doing non-nerdy things. Mike can be found on Twitter at @mgirouard and even keeps an infrequently updated blog at lovemikeg.com.

More About Mike »

NFJS, the Magazine

December Issue Now Available
  • BDD and REST

    by Brian Sletten
  • Mocks and Stubs in Groovy Tests

    by Kenneth Kousen
  • Algorithms for Better Text Search Results

    by John Griffin
  • Knowns and Unknowns of Scrum and Agile

    by Brian Tarbox
Learn More »