jQuery $(window).load


/ Published in: JavaScript
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  1. $(window).load(function(){
  2. // jQuery functions to initialize after the page has loaded.
  3. });

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.