jquery错误: Cannot read property ‘msie’ of undefined

背景

Web application, 引用了jquery 1.10.2和fancybox 1.3.4

现象

访问页面遭遇Cannot read property ‘msie’ of undefined的报错

原因

fancybox尝试使用$.browser, 但$.browser从jQuery1.9开始就正式废除,因此报错

解决办法

下载jquery-migrate-1.2.2,在引用jquery库之后引用jquery-migrate,错误解决

<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
时间: 2024-07-30 10:13:00

jquery错误: Cannot read property ‘msie’ of undefined的相关文章

[jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 --转

初用Yii的srbac模块.出现 Cannot read property ‘msie’ of undefined 错误.上网查询,找到如下的文章.使用文末的打补丁的方法,成功搞定.感谢. =============================== http://blchen.com/jquery-can-not-read-property-msie-of-the-undefined-error-solution/ 最近把一个项目的jQuery升级到最新版,发现有些页面报错Cannot re

jquery升级到新版本报错[jQuery] Cannot read property ‘msie’ of undefined错误的解决方法(转)

最近把一个项目的jQuery升级到最新版,发现有些页面报错Cannot read property 'msie' of undefined.上jQuery网站上搜了一下,原因是$.browser这个api从jQuery1.9开始就正式废除,js代码里只要用到$.browser就会报这个错.具体说明参见jQuery官方说明. 楼主顺便扩展阅读了一下,发现jQuery· 1.9之后的版本把所有在早期版本里标记为deprecated的api都正式删除了,不再向后兼容.对于升级到最新jQuery的童鞋而

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

使用ztree时候没有用默认的1.4版本jquery,报错Cannot read property ‘msie’ of undefined $.browser这个api从jQuery1.9开始就正式废除,js代码用到$.browser就会报这个错.详细说明参见官方说明 解决方法加入下面代码,jQuery文件加载之后,使用$.browser的代码之前. jQuery.browser={};(function(){jQuery.browser.msie=false; jQuery.browser.v

Uncaught TypeError: Cannot read property &#39;msie&#39; of undefined

Uncaught TypeError: Cannot read property 'msie' of undefined 因为图方便,抄了别人写的一个jquerry插件,运行时“var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ) ? 'absolute' : 'fixed'; ”报了Uncaught TypeError: Cannot read property 'msie' of undefined的错误.

获取判断IE版本 TypeError: Cannot read property &#39;msie&#39; of undefined

注意:一下方法只适用于IE11 以下: TypeError: Cannot read property 'msie' of undefined jquery1.9去掉了 $.browser  所以报错 官方说明 : https://api.jquery.com/jQuery.browser/ 1 大佬的贴:   https://stackoverflow.com/questions/14892095/browser-msie-error-after-update-to-jquery-1-9-1

Uncaught TypeError: Cannot read property &#39;call&#39; of undefined jquery.validate.min.js:28

最近在做表单校验的时候,自己写的addMethod 方法老是不起作用,折腾了接近一天的时间.报的错误如下 Uncaught TypeError: Cannot read property 'call' of undefinedjquery.validate.min.js:28 先来看一下 我自己页面的布局. top.jsp 上面的截图为top.jsp的头部引用的表单校验jquery-1.6.js和jquery.validate.min.js 我来看我自己需要校验的那个页面的jsp布局(stepT

jQuery mobile报错 Uncaught TypeError: Cannot read property &#39;concat&#39; of undefined

写一个jQuery mobile的demo <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="styl

解决discuz与jquery不兼容问题——下拉列表不能用(Uncaught TypeError: Cannot set property &#39;position&#39; of undefined)

问题描述: 最近学着用discuz来模仿一个门户网站,里面要把导航条做出滑动效果,要用到jquery,将要用到jquery引用到header.htm中,如下图所示: 但是由于discuz采用php以及本身的机制,jquery中的$会与discuz本身的common.js和forum.js产生冲突,会出现如下的错误导致下拉列表 解决办法: 解决思路:将jquery的$重新定义一下,比如我门将用jq代表jquery的$ 在jquery-1.7.2.js的末尾加上一句如下代码: var jq = $.

Uncaught TypeError: Cannot set property &#39;f7View&#39; of undefined 错误原因

// 添加视图var mainView = myApp.addView('.view-main', { // 因为我们要用动态的导航栏,我们需要使它的这一观点: dynamicNavbar: true});// 添加视图var mainView4 = myApp.addView('.view-main4', { // 因为我们要用动态的导航栏,我们需要使它的这一观点: dynamicNavbar: true}); 错误原因,多了一个添加视图,删除一个就好 Uncaught TypeError: