jQuery 3.0 url.indexOf错误 [英] jquery 3.0 url.indexOf error

查看:104
本文介绍了jQuery 3.0 url.indexOf错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一旦它更新为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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆