Just curious if there's an easy way to add functions to the $(window).load()
event before it has fired. For example, if you call $(window).load()
twice in the beginning of the page, only the function of the second call will execute onload
.
Is there some sort of tool built into jQuery for adding to the onload
event instead of replacing it? If so, how about for the $(document).ready()
call?
They actually do stack in the order specified. Here's an example : http://jsfiddle.net/73D9Z/
I've used window.ready()
$(window).ready(function(){
alert('window ready 1');
});
$(window).ready(function(){
alert('window ready 2');
});
$(document).ready(function(){
alert('document ready 1');
});
$(document).ready(function(){
alert('document ready 2');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With