Friday, October 28, 2016

window.onload

JavaScript's window.onload will occur after all the content on a page, images and all, has finished loading while jQuery's $(document).ready() happens when just the HTML is done loading. Use window.onload like so:

window.onload = function() {
   alert('whatever');
};

No comments:

Post a Comment