首页 > 代码库 > js 判断ie

js 判断ie

  

var isIE = !!window.ActiveXObject;    var isIE6 = isIE && !window.XMLHttpRequest;    var isIE7 = !!(!window.addEventListener && window.XMLHttpRequest && !document.querySelectorAll);    var isIE8 = !!(!window.addEventListener && document.querySelectorAll);    $(function(){        if(isIE || isIE6 || isIE7 || isIE8){           //do something        }else{           //do something        }    })

 

js 判断ie