Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

if $(window).load() is deprecated, what should I use?

Tags:

html

jquery

load

I need a function that is called when the page is totally loaded (text, image, and so on).

I noticed that $(window).load() is now deprecated. So, what should I use?

like image 791
markzzz Avatar asked Dec 02 '22 19:12

markzzz


1 Answers

If you want just avoid the load function, use the generic on function :

$(window).on('load', function(){
  // insert code here
});
like image 138
3 revs, 2 users 94% Avatar answered Dec 15 '22 06:12

3 revs, 2 users 94%