如果$(window).load()已被弃用,我应该使用什么? [英] if $(window).load() is deprecated, what should I use?
本文介绍了如果$(window).load()已被弃用,我应该使用什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我注意到 $(window).load()
现已被弃用。那么,我该用什么?
加载
函数,在函数上使用通用的:
$ $ p $ $ $ $ $ ).on('load',function(){
//在此处插入代码
});
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?
解决方案
If you want just avoid the load
function, use the generic on
function :
$(window).on('load', function(){
// insert code here
});
这篇关于如果$(window).load()已被弃用,我应该使用什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文