[jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法

简介: 原文: [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法 $.browser在jQuery1.9里被删除了,所以项目的js代码里用到$.browser的地方就会报这个错。
原文: [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法

$.browser在jQuery1.9里被删除了,所以项目的js代码里用到$.browser的地方就会报这个错。

jQuery1.9里对不少API做了废弃或者删除。幸运的是,jQuery社区考虑到了这么做给开发人员带来的麻烦,在1.9同时也推出了一个新插件jQuery Migration,该插件可以检查出在1.9之后被废弃或者删除的API,恢复原有功能,从而保证已有的js代码能在最新的jQuery下正常运行。

下面是具体的解决方法,只需要在jQuery引用后加上一行对jQuery Migration的引用即可。

 

<script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.1.1.js"></script>

 

目录
相关文章
|
2月前
|
存储 JavaScript 前端开发
成功解决:Cannot read properties of undefined (reading ‘commit‘)
这篇文章提供了解决Vuex中"Cannot read properties of undefined (reading 'commit')"错误的两种方法:检查模板中的数据属性是否存在,以及确保在Vue实例中正确挂载了store对象。
成功解决:Cannot read properties of undefined (reading ‘commit‘)
|
2月前
|
定位技术 Apache
Echarts——Invalid geoJson format Cannot read property 'length' of undefined
Echarts——Invalid geoJson format Cannot read property 'length' of undefined
56 0
|
2月前
|
JavaScript
VUE——filemanager-webpack-plugin报错TypeError: Cannot read property 'isFile' of undefined
VUE——filemanager-webpack-plugin报错TypeError: Cannot read property 'isFile' of undefined
45 0
|
2月前
|
前端开发 JavaScript
VUE——Uncaught (in promise) TypeError: Cannot read property '__esModule' of undefined
VUE——Uncaught (in promise) TypeError: Cannot read property '__esModule' of undefined
34 0
|
4月前
|
前端开发 小程序 JavaScript
微信小程序-Unhandled promise rejection TypeError: Cannot read property ‘get‘ of undefined
微信小程序-Unhandled promise rejection TypeError: Cannot read property ‘get‘ of undefined
|
5月前
|
资源调度 前端开发
编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent‘)
编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent‘)
425 0
TypeError: Cannot set properties of undefined (setting ‘resdata‘),res定义数据出现的问题,定义的方法用this换成that
TypeError: Cannot set properties of undefined (setting ‘resdata‘),res定义数据出现的问题,定义的方法用this换成that
Cannot read properties of undefined (reading ‘row‘)
Cannot read properties of undefined (reading ‘row‘)
Cannot read properties of undefined (reading ‘post‘)
Cannot read properties of undefined (reading ‘post‘)
|
3月前
|
JavaScript
element-ui Cannot read properties of undefined (reading ‘name‘),data中写成集合的形式
element-ui Cannot read properties of undefined (reading ‘name‘),data中写成集合的形式

相关课程

更多