问题描述

jQuery升级到3.0.0后类型错误

jquery.js:9612 Uncaught TypeError: url.indexOf is not a function

问题解决

这个错误是由于调用了load函数导致的错误

把代码里调用load函数的方式

$(window).load(function() { ... });

改为

$(window).on('load', function() { ... });

注意:.load(), .unload(), and .error()从jQuery 1.8开始就被废弃了,换成使用.on()函数来注册.

错误信息

jquery.js:9612 Uncaught TypeError: url.indexOf is not a function

就是源自jQuery.fn.load函数

jquery.js 3.0报错, Uncaught TypeError: url.indexOf is not a function的更多相关文章

  1. jQuery3.0+报错Uncaught TypeError: e.indexOf is not a function

    jQuery3.0+报错Uncaught TypeError: e.indexOf is not a function 使用.load()绑定事件时报错,Uncaught TypeError: e.i ...

  2. jquery3.1.1报错Uncaught TypeError: a.indexOf is not a function

    jquery3.1.1报错Uncaught TypeError: a.indexOf is not a function 使用1.9就没有问题,解决办法: 就是把写的代码中: $(window).lo ...

  3. 使用zepto中animate报错“Uncaught TypeError: this.bind is not a function”的解决办法

    在使用zepto时,我先引入zepto.min.js,然后引入fx.js,但是在使用animate函数时,控制台却报如下错误: Uncaught TypeError: this.bind is not ...

  4. 简记webpack运行报错 Uncaught TypeError: self.postMessage is not a function

    说好2017Fix的还是能重现,可能项目的版本比较旧了,简要记录解决办法 1.错误: index.js?bed3:67 Uncaught TypeError: self.postMessage is ...

  5. js报错 Uncaught TypeError: xxxx.each is not a function

    在处理ajax返回的json数组时错误的使用了 list.each(function(){ }); 实际上当遍历json数组是应该使用 $.each(list,function(index,cours ...

  6. 擦他丫的,今天在Django项目中引用静态文件jQuery.js 就是引入报错,终于找到原因了!

    擦 ,今天在Django项目中引用静态文件jQuery.js 就是引入报错,终于找到原因了! 问题在于我使用的谷歌浏览器,默认使用了缓存,导致每次访问同一个url时,都返回的是缓存里面的东西.通过谷歌 ...

  7. js 报错 Uncaught TypeError: Cannot read property 'trim' of undefined

    jquery Uncaught TypeError: Cannot read property 'trim' of undefined 报错原因及解决方案 $.trim() 函数用于去除字符串两端的空 ...

  8. jS Ajax 上传文件报错"Uncaught TypeError: Illegal invocation"

    使用jquery ajax异步提交文件的时候报Uncaught TypeError :Illegal invocation错误,报错信息如图: 错误原因: jQuery Ajax 上传文件处理方式,使 ...

  9. 前台报错:Uncaught TypeError: Cannot read property '0' of null

    错误现象: var div1=mycss[0].style.backgroundColor;  //这一行提示360和chrome提示:Uncaught TypeError: Cannot read  ...

随机推荐

  1. zabbix agent配置详解(windows)

    客户端操作  标注:监控zabbix_agentd客户端安装对象是win server 2008操作系统 64位. 1.  下载zabbix_agentd监控客户端软件安装包(windows操作系统客 ...

  2. CentOS6.4下邮件服务器搭建

    CentOS6.4下邮件服务器搭建   linux下邮件服务器的搭建大致分为三个步骤 准备工作(真实的生产环境下需要) 发送服务器安装及配置 (Postfix) 接收服务器安装及配置(dovecot) ...

  3. Java用Gson遍历json所有节点

    <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</ar ...

  4. Golang内存分配内置函数之new函数

    new函数用来分配内存,主要分配值类型,比如int.float32.struct等,返回的是指针 package main import ( "fmt" ) func main() ...

  5. MacOS Docker 安装

    使用 Homebrew 安装 macOS 我们可以使用 Homebrew 来安装 Docker. Homebrew 的 Cask 已经支持 Docker for Mac,因此可以很方便的使用 Home ...

  6. python简说(十二)time模块

    1.时间戳 print(int(time.time())) 2.取当前格式化好的时间 time.strftime('%Y-%m-%d %H:%M:%S') 3.时间戳转为格式化好的时间 time1 = ...

  7. 学习MFC的建议

    1.继续深入学习C++的内容,打好面向对象的程序综合设计与编程基础,参考书籍<C++Primer>. 2.打好Windows编程基础(参考书<Windows程序设计>(第五版) ...

  8. 2018-2019-2 《网络对抗技术》Exp3 免杀原理与实践 20165211

    目录 2018-2019-2 <网络对抗技术>Exp3 免杀原理与实践 20165211 1. 基础问题回答 (1)杀软是如何检测出恶意代码的? (2)免杀是做什么? (3)免杀的基本方法 ...

  9. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem E (Codeforces 831E) - 线段树 - 树状数组

    Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this int ...

  10. JavaScript中数组的排序方法:1.冒泡排序 2.选择排序

      //1.选择排序: //从小到大排序:通过比较首先选出最小的数放在第一个位置上,然后在其余的数中选出次小数放在第二个位置上,依此类推,直到所有的数成为有序序列. var arr2=[19, 8, ...