jQuery 3.0 url.indexOf错误 [英] jquery 3.0 url.indexOf error
问题描述
一旦它更新为v3.0.0
,我就会从jQuery得到错误提示.
I am getting following error from jQuery once it has been updated to v3.0.0
.
jquery.js:9612 Uncaught TypeError: url.indexOf is not a function
知道为什么吗?
推荐答案
更新您所有调用load
函数的代码,例如
Update all your code that calls load
function like,
$(window).load(function() { ... });
收件人
$(window).on('load', function() { ... });
jquery.js:9612未捕获的TypeError:url.indexOf不是函数
jquery.js:9612 Uncaught TypeError: url.indexOf is not a function
此错误消息来自jQuery.fn.load
函数.
I've come across the same issue on my application. After some digging, I found this statement in jQuery blog,
自jQuery 1.8起,.load,.unload和.error就不再使用了.. 使用.on()注册侦听器.
.load, .unload, and .error, deprecated since jQuery 1.8, are no more. Use .on() to register listeners.
我只是简单地改变我的jQuery对象如何调用上述load
函数.一切都按预期进行.
I simply just change how my jQuery objects call the load
function like above. And everything works as expected.
这篇关于jQuery 3.0 url.indexOf错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!