我使用 jQuery 在 MVC 中开发了一个 Web 应用程序应用程序。
现在我一次又一次地收到此错误。我不知道我现在错过了什么。
有人可以指导我吗?
它会在浏览器控制台中抛出此错误消息:
jQuery.Deferred exception: url.indexOf is not a function TypeError: url.indexOf is not a function
at jQuery.fn.init.jQuery.fn.load (http://localhost:5713/Scripts/jquery-3.1.1.js:9793:13)
at HTMLDocument. (http://localhost:5713/Theme/js/main.js:27:12)
at mightThrow (http://localhost:5713/Scripts/jquery-3.1.1.js:3570:29)
at process (http://localhost:5713/Scripts/jquery-3.1.1.js:3638:12) undefined jQuery.Deferred.exceptionHook @ jquery-3.1.1.js:3846
jquery-3.1.1.js:3855 Uncaught TypeError: url.indexOf is not a function
at jQuery.fn.init.jQuery.fn.load (jquery-3.1.1.js:9793)
at HTMLDocument. (main.js:27)
at mightThrow (jquery-3.1.1.js:3570)
at process (jquery-3.1.1.js:3638)
最佳答案
与 Jquery 3.x
图书馆发生了一些重大变化
Jquery 删除了 load
, unload
和error
完全事件监听器,尽管它们早在 Jquery 1.8
中就已被弃用。 .
使用.on
注册您的事件。
关于jquery - 如何修复 jQuery.fn.init.jQuery 中未定义的 jquery url.indexOf 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44604167/