Posted By

jonkemp on 06/29/10


Tagged

javascript jquery


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

reynish
romainsauger
McWatt
wirenaught
Beppoi


jQuery $(window).load


 / Published in: JavaScript
 

URL: http://www.artzstudio.com/2009/04/jquery-performance-rules/

Although $(document).ready is incredibly useful, it occurs during page render while objects are still downloading. You can reduce CPU utilization during the page load by binding your jQuery functions to the $(window).load event, which occurs after all objects called by the HTML (including content) have downloaded.

  1. $(window).load(function(){
  2. // jQuery functions to initialize after the page has loaded.
  3. });

Report this snippet  

You need to login to post a comment.