Uncaught TypeError: Cannot read property 'msie' of undefined
2017-10-18 15:01
761 查看
错误:
Uncaught TypeError: Cannot read property ‘msie’ of undefined
原因:
$.browser方法在 jQuery 1.9中被移除了
解决办法:
1.下载官方插件(网上大部分人是这么解决的,然而我的bug用这个没有解决)
2.自己写一段 $.browser代码进去(推荐)
写在jQuery引用之后的script里面
Uncaught TypeError: Cannot read property ‘msie’ of undefined
原因:
$.browser方法在 jQuery 1.9中被移除了
解决办法:
1.下载官方插件(网上大部分人是这么解决的,然而我的bug用这个没有解决)
<script src="http://code.jquery.com/jquery-1.9.0.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
2.自己写一段 $.browser代码进去(推荐)
写在jQuery引用之后的script里面
jQuery.browser = {}; (function () { jQuery.browser.msie = false; jQuery.browser.version = 0; if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) { jQuery.browser.msie = true; jQuery.browser.version = RegExp.$1; } })();
相关文章推荐
- Uncaught TypeError: Cannot read property 'msie' of undefined
- Uncaught TypeError: Cannot read property 'msie' of undefined
- Uncaught TypeError: Cannot read property 'msie' of undefined
- echarts.min.js:25 Uncaught TypeError: Cannot read property 'features' of undefined
- Uncaught TypeError: Cannot read property 'length' of undefined
- Uncaught TypeError: Cannot read property 'val' of undefined
- Uncaught TypeError: Cannot read property 'fn' of undefined
- Uncaught TypeError: Cannot read property 'decimalSeparator' of undefined
- uploadify的JS组件报错:Uncaught TypeError: Cannot read property 'queueData' of undefined
- js的form(load报错jquery.easyui.min.js:2837 Uncaught TypeError: Cannot read property 'tip' of undefined
- Uncaught TypeError: Cannot read property 'substring' of undefined
- Uncaught TypeError: Cannot read property 'decimalSeparator' of undefined
- 关于Uncaught TypeError: Cannot read property 'toLowerCase' of undefined的问题
- tankgame2.js:37 Uncaught TypeError: Cannot read property 'direct' of undefined(…)
- Uncaught TypeError: Cannot read property 'substring' of undefined
- Uncaught TypeError: Cannot read property 'length' of undefined
- Uncaught TypeError: Cannot read property 'trigger' of undefined(zepto.js)
- Uncaught TypeError: Cannot read property 'number' of undefined
- Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
- vue Uncaught TypeError: Cannot read property 'gc' of undefined