注意:以下方法只适用于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

/**
* Returns the version of Internet Explorer or a -1
* (indicating the use of another browser).
*/
function getInternetExplorerVersion()
{
var rv = -1; // Return value assumes failure. if (navigator.appName == 'Microsoft Internet Explorer')
{
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat( RegExp.$1 );
} return rv;
} function checkVersion()
{
var msg = "You're not using Internet Explorer.";
var ver = getInternetExplorerVersion(); if ( ver > -1 )
{
if ( ver >= 8.0 )
msg = "You're using a recent copy of Internet Explorer."
else
msg = "You should upgrade your copy of Internet Explorer.";
} alert( msg );
}

方法 2:

// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
// And to detect the version:
// ie === 6 // IE6
// ie > 7 // IE8, IE9 ...
// ie < 9 // Anything less than IE9
// ---------------------------------------------------------- // UPDATE: Now using Live NodeList idea from @jdalton var ie = (function(){ var undef,
v = 3,
div = document.createElement('div'),
all = div.getElementsByTagName('i'); while (
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
all[0]
); return v > 4 ? v : undef; }());

方法 3

if (navigator.userAgent.toLowerCase().indexOf('msie 6') != -1){

}

6为你要测试的版本号

最新文章

  1. Paypal支付小记
  2. 发现大量的TIME_WAIT解决办法
  3. Android NDK学习之第一个实例---端口扫描
  4. playframework文档未提及,但你能做的事
  5. javascript运行机制之执行顺序详解(转)
  6. uCGUI简介
  7. ECMAScript一元操作符
  8. 转:php中实现精确设置session过期时间的方法
  9. Hibernate分页
  10. 在网上看到一个关于APP的测试
  11. hadoop部署工具与配置工具
  12. java之观察者模式
  13. 压缩js参数保存解决方法
  14. 【TRICK】解决锚点定位向下浮动Xpx问题
  15. 过渡与动画 - steps调速函数&amp;CSS值与单位之ch
  16. LeetCode 456. 132 Pattern
  17. s11 day105
  18. oracle卸载清除注册表(彻底卸载)
  19. [mysql] 先按某字段分组再取每组中前N条记录
  20. 报错:Cobbler check 时报错

热门文章

  1. videojs兼容ie8
  2. 01-springboot整合elasticsearch初识
  3. vue页面原样导出excel表格
  4. centos7安装Mysql爬坑记录
  5. 初识C#扩展方法
  6. 记一次实际开发过程中遇到事务报错问题 Transaction synchronization is not active
  7. Mysql 常用语句实战(2)
  8. Python爬虫:手把手教你写迷你爬虫架构
  9. windows下的包管理器scoop
  10. scrapy(三):post请求