jQuery .load() was deprecated in version 1.8.
If I wanted to perform the following task:
$(window).load(function () {
// run code
});
How would I do this in jQuery 1.9+?
jQuery .load() was deprecated in version 1.8.
If I wanted to perform the following task:
$(window).load(function () {
// run code
});
How would I do this in jQuery 1.9+?
That was just a shortcut to the equivalent .on
call, so use that instead:
$(window).on('load', function () {
// run code
});
If you don't care about multiple handlers, you can go with the basic window.onload = function...
.