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

2019-05-07 12:03发布

问题:

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?

回答1:

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

$(window).on('load', function(){
  // insert code here
});


标签: jquery html load