关于jquery使用live()方法的问题Uncaught TypeError: $(...).live is not a function
来源:互联网 发布:gre单词书推荐 知乎 编辑:程序博客网 时间:2024/05/20 09:08
一、出问题原因
在维护旧项目的时候,出现浏览器控制台报错Uncaught TypeError: $(...).live is not a function
Uncaught TypeError: $(...).live is not a function at HTMLDocument.eval (eval at <anonymous> (jquery-1.11.3.js:339), <anonymous>:17:41) at fire (jquery-1.11.3.js:3148) at Object.add [as done] (jquery-1.11.3.js:3194) at jQuery.fn.init.jQuery.fn.ready (jquery-1.11.3.js:3428) at jQuery.fn.init (jquery-1.11.3.js:2868) at jQuery (jquery-1.11.3.js:73) at eval (eval at <anonymous> (jquery-1.11.3.js:339), <anonymous>:3:2) at eval (<anonymous>) at jquery-1.11.3.js:339 at Function.globalEval (jquery-1.11.3.js:340)
二、修改和说明
1、说明
on() 方法在被选元素及子元素上添加一个或多个事件处理程序。自 jQuery 版本 1.7 起,on() 方法是 bind()、live() 和 delegate() 方法的新的替代品。该方法给 API 带来很多便利,我们推荐使用该方法,它简化了 jQuery 代码库。注意:使用 on() 方法添加的事件处理程序适用于当前及未来的元素(比如由脚本创建的新元素)。提示:如需移除事件处理程序,请使用 off() 方法。提示:如需添加只运行一次的事件然后移除,请使用 on() 方法。2、修改
在项目中所有使用jquery的live()方法都修改成on()方法,使用方法相同,只用修改方法名即可。
0 0
- 关于jquery使用live()方法的问题Uncaught TypeError: $(...).live is not a function
- jQuery中live()使用报错,TypeError: $(...).live is not a function
- jQuery中live()使用报错,TypeError: $(...).live is not a function(转)
- 关于Jquery错误的解决:Uncaught TypeError: $.post is not a function
- jQuery 1.9 .live() is not a function
- TypeError: a(...).live is not a function(jquery.unobtrusive-ajax.min.js 引入报错)
- 【JQuery】sortable.js Uncaught TypeError $(...).sortable is not a function
- Uncaught TypeError: jQuery.handleError is not a function
- jQuery 异常 Uncaught TypeError: url.indexOf is not a function
- $(...).live is not a function
- $(...).live is not a function
- chrome浏览器Uncaught TypeError: object is not a function问题
- chrome浏览器Uncaught TypeError: object is not a function问题
- Uncaught TypeError: undefined is not a function
- Uncaught TypeError: string is not a function
- Uncaught TypeError: object is not a function
- Uncaught TypeError: undefined is not a function
- Uncaught TypeError: undefined is not a function
- Android应用开发学习笔记04--使用布局
- 4412驱动-poll 阻塞
- 【python】mysqldb Windows安装
- 简称ag的the_silver_searcher介绍,搜索代码神器
- linux操作
- 关于jquery使用live()方法的问题Uncaught TypeError: $(...).live is not a function
- 琐碎的区间(线段树区间更新 + 技巧!)
- 分布式消息系统 Kafka源码安装
- python项目练习一:即时标记
- Protobuf 有没有比 JSON 快 5 倍?
- POJ 1018. Communication System 动态规划解法
- Pointfree 编程风格指南
- POJ 2891 Strange Way to Express Integers(非互质中国剩余定理)
- Angular.js之手动调用$apply()以及$digest()的理解