Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
When the .load method is used on an HTML element, it is an AJAX call. If you use it on the window, however, it is a page load event, exactly like the normal JavaScript onload event, except that it may appear in multiple places throughout the script:
Code:
$(window).load(function() {
//do stuff
});
Note that there is no need to put this inside of the $(document).ready(), which is a separate loading event. $(document).ready() waits for the HTML to load, but not the images. $(window).load() will wait for all of the images to load, in addition to the HTML.
Last edited by wayfarer07; 04-22-2009 at 05:10 PM..
|