我浏览jQuery api并注意到
load method是在已弃用的列表。
Categories: Deprecated | Events > Document Loading
我通常使用这种方法来检查图像是否完全加载。为什么不推荐使用?我应该使用什么?
解决方法@H_502_10@
参见
bug #11733,其中描述了此弃用:
The .load()
method is an ambiguous signature,it can either be an ajax
load or attach/fire a “load” event. 07001 cannot tell them apart since
it’s a dynamic decision based on arguments.
$("selector").load(function() {
// ...
});
应变成:
$("selector").on("load",function() {
// ...
});
The
.load()
method is an ambiguous signature,it can either be an ajax
load or attach/fire a “load” event. 07001 cannot tell them apart since
it’s a dynamic decision based on arguments.
$("selector").load(function() { // ... });
应变成:
$("selector").on("load",function() { // ... });