首页 > Web开发 > 详细

纯JS判断IE浏览器版本

时间:2015-01-20 19:48:16      阅读:336      评论:0      收藏:0      [点我收藏+]

IE11或者非IE

if (!document.all) {
    alert(‘IE11+ or not IE‘);
}

IE10

if (document.all && document.addEventListener && window.atob) {
    alert(‘IE10‘);
}

IE9

if (document.all && document.addEventListener && !window.atob) {
    alert(‘IE9‘);
}

IE8

if (document.all && document.querySelector && !document.addEventListener) {
    alert(‘IE8‘);
}

IE7

if (document.all && window.XMLHttpRequest && !document.querySelector) {
    alert(‘IE7‘);
}

IE6

if (document.all && document.compatMode && !window.XMLHttpRequest) {
    alert(‘IE6‘);
}

 

纯JS判断IE浏览器版本

原文:http://www.cnblogs.com/cnsevennight/p/4236700.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!