jquery - 如何修复 jQuery.fn.init.jQuery 中未定义的 jquery url.indexOf 函数?

标签 jquery asp.net-mvc

我使用 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 Breaking Changes

Jquery 删除了 load , unloaderror完全事件监听器,尽管它们早在 Jquery 1.8 中就已被弃用。 .

使用.on注册您的事件。

关于jquery - 如何修复 jQuery.fn.init.jQuery 中未定义的 jquery url.indexOf 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44604167/

相关文章:

jquery - 从 select2 中选定的选项获取 optGroup id

php - 使用 PHP 从 MySQL 表中获取值并在 jQuery 函数中将结果显示为 "option"

c# - 为什么 View 模型不可能从 Entity Framework 中的模型继承

javascript - 类似于 ASP.NET MVC 中的 SO 的投票系统

asp.net-mvc - 为什么 MVC 页面编译会强制应用程序在我的 Azure Web 应用程序上不断重新启动?

javascript - jQuery Perfect Scroll——将滚动条设置到容器底部

javascript - 无法让 margin-bottom 在搜索框上工作?

javascript - Window.open 打开空白的新标签页?

jquery - 传递给 J 查询 token 输入的附加参数

jquery - 如何清除 Telerik ASP.NET MVC Grid 上的过滤器