1、判断是否为IE8及以下版本:
if (!+[1,]) {alert('<=8');}
2、判断是否为IE9及以下版本:
if (!('placeholder' in document.createElement('input'))) {alert('<=9');}
3、判断是否为IE10及以下版本:
if (!!document.all) {alert('<=10');}
4、判断是否为IE浏览器:
if(!!window.ActiveXObject || "ActiveXObject" in window){alert('Is IE');}
5、判断是否为Edge浏览器:
if (navigator.userAgent.indexOf("Edge") > -1) {alert('Is Edge');}
6、判断是否为指定版本IE,比如判断是否为IE8或者IE10:
if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace(/[ ]/g, "") in {'MSIE8.0': '','MSIE10.0': ''}) {alert(true)}