问题描述

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. JustOj 1927: 回文串

    题目描述 回文串是从左到右或者从右到左读起来都一样的字符串,试编程判别一个字符串是否为回文串. 输入 输入一个字符串.串长度<255. 输出 判别输入的字符串是否为回文串,是输出"Y& ...

  2. 动态创建生成lambd表达式

    基于网上找的一段代码进行修改,目前扩展了NotContains方法的实现 using System; using System.Collections.Generic; using System.Co ...

  3. Python智能检测编码并转码

    #安装包工具 $pip3 install chardet #直接打开文件,中文显示乱码 >>> import chardet >>> f = open('test. ...

  4. Logstash 安装和使用

    下载地址 https://artifacts.elastic.co/downloads/logstash/logstash-5.6.8.zip 下载后解压,测试 #将键盘内容输出到控制台 logsta ...

  5. body中相关标签

    一.字体标签 字体标签包含:h1~h6.<font>.<u>.<b>.<strong><em>.<sup>.<sub> ...

  6. DGUT_FLY退役贴 && FunCfans毕业总结-竞赛篇

    严格来说我们飞跃队是去年ECFinal之后就退役的,只是这几个月有一堆事情在那,考研的考研,求职的求职,都把博客晾一边了.现在,总算能写点东西了. 我与ACM-ICPC的结缘,是从大一开学1个多月后开 ...

  7. P1382 楼房

    P1382 楼房 每个矩形拆成2个坐标按$x$轴排序,蓝后$multiset$维护最高值. #include<iostream> #include<cstring> #incl ...

  8. Examples of Scikit-learn Usages

    Examples of Scikit-learn Usages KFold K-折交叉验证 >>> import numpy as np >>> from skle ...

  9. opencv学习之路(1)、示例程序

    一.介绍 工欲善其事必先利其器,首先当然是配置环境安装软件啦.  我安装的vs2012+opencv2.48以及opencv3.0.具体安装步骤按照浅墨大神的博客进行即可:http://blog.cs ...

  10. Bugku-CTF之web基础$_GET

    Day3   web基础$_GET   http://123.206.87.240:8002/get/   打开之后是一段代码