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

北城余情 提交于 2019-12-22 09:17:05

问题


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
});


来源:https://stackoverflow.com/questions/16735534/if-window-load-is-deprecated-what-should-i-use

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!