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的错误。
判断浏览器类型:
$.browser.mozilla = /firefox/.test(navigator.userAgent.toLowerCase());
$.browser.webkit = /webkit/.test(navigator.userAgent.toLowerCase());
$.browser.opera = /opera/.test(navigator.userAgent.toLowerCase());
$.browser.msie = /msie/.test(navigator.userAgent.toLowerCase());
等号后面的表达式返回的就是 true/false, 可以直接用来替换原来的 $.browser.msie 等。
检查是否为 IE6:
// Old
if ($.browser.msie && 7 > $.browser.version) {}
// New
if ('undefined' == typeof(document.body.style.maxHeight)) {}
检查是否为 IE 6-8:
if (!$.support.leadingWhitespace) {}
Uncaught TypeError: Cannot read property 'msie' of undefined的更多相关文章
- easyui使用时出现这个Uncaught TypeError: Cannot read property 'combo' of undefined
easyui使用时出现这个Uncaught TypeError: Cannot read property 'nodeName' of undefined 最后检查发现是必须给select一个id,光 ...
- reactjs Uncaught TypeError: Cannot read property 'location' of undefined
reactjs Uncaught TypeError: Cannot read property 'location' of undefined reactjs 路由配置 怎么跳转 不成功 国内搜索引 ...
- index.js:13 Uncaught TypeError: Cannot read property 'split' of undefined
使用 webpack 编译 Vue 项目时出现报错: index.js:13 Uncaught TypeError: Cannot read property 'split' of undefined ...
- Uncaught TypeError: Cannot read property ‘split’ of undefined
问题 :Uncaught TypeError: Cannot read property ‘split’ of undefinedat HTMLLIElement. split()切割的问题 因为遍历 ...
- SignalR代理对象异常:Uncaught TypeError: Cannot read property 'client' of undefined 推出的结论 SignalR 简单示例 通过三个DEMO学会SignalR的三种实现方式 SignalR推送框架两个项目永久连接通讯使用 SignalR 集线器简单实例2 用SignalR创建实时永久长连接异步网络应用程序
SignalR代理对象异常:Uncaught TypeError: Cannot read property 'client' of undefined 推出的结论 异常汇总:http://www ...
- DataTable插件报错:Uncaught TypeError: Cannot read property 'style' of undefined
DataTable插件报错:Uncaught TypeError: Cannot read property 'style' of undefined 原因:table 中定义的列和aoColumns ...
- underscore.js定义模板遇到问题:Uncaught TypeError: Cannot read property 'replace' of undefined
代码正确缩进位置如下, extend "layout" block 'content',-> div ->'nihao' script id:"Invoice ...
- Uncaught TypeError: Cannot read property 'decimalSeparator' of undefined
1.错误描述 jquery.jqGrid.min.js:477 Uncaught TypeError: Cannot read property 'decimalSeparator' of undef ...
- 【jQuery】jquery中 使用$('#parentUid').attr(parentUid);报错jquery-1.11.3.min.js:5 Uncaught TypeError: Cannot read property 'nodeType' of undefined
jquery中 使用$('#parentUid').attr(parentUid);报错jquery-1.11.3.min.js:5 Uncaught TypeError: Cannot read p ...
随机推荐
- 字符编码笔记:ASCII,Unicode和UTF-8(转载)
作者: 阮一峰 日期: 2007年10月28日 今天中午,我突然想搞清楚Unicode和UTF-8之间的关系,于是就开始在网上查资料. 结果,这个问题比我想象的复杂,从午饭后一直看到晚上9点,才算初步 ...
- chattr和lsattr
这两个命令是和权限有关 1.chattr +i carlton.txt 对carlton.txt文件进行锁定,谁也不能进行任何修改,取消的话可以chattr -i carlton.txt 就可以 2. ...
- 繁星——jquery的data()方法
今天在看JQuery文档的时候偶然看到了data()方法,觉得挺好用的,这里做个记录. 这个方法用于在元素上存放数据,返回jQuery对象.在文档中提到V1.4.3 新增用法NEW data(obj) ...
- 15个实用的jQuery代码片
(function($) { var cache = []; // Arguments are image paths relative to the current page. $.preLoadI ...
- hadoop运行原理之Job运行(五) 任务调度
接着上篇来说.hadoop首先调度辅助型task(job-cleanup task.task-cleanup task和job-setup task),这是由JobTracker来完成的:但对于计算型 ...
- gbk与utf-8转换
linux: #include <iconv.h> int code_convert(char *from_charset,char *to_charset,char *inbuf,int ...
- 带转义符的json解释
1.json数组:jsonData.取json数组中message的appid的值.例子: var jsonData = { "code":"200", &qu ...
- C#将字节流加密解密
public class Encrypt { public static byte[] ToEncrypt(string encryptKey, byte[] P_byte_data) { try { ...
- pyinstaller 用法
参考:http://pythonhosted.org/PyInstaller/#installing-pyinstaller 1.下载pyinstaller和PyWin32 目前pyinstalle ...
- ie8 window.open导出文件报错
js创建一个<a>元素hiddenElementhiddenElement.setAttribute('href','')hiddenElement.setAttribute('targe ...