检测是否IE浏览器

1 function browserIsIE(){
2     if (window.ActiveXObject)
3         return true;
4     else{          
5           var u_agent = navigator.userAgent.toLowerCase(); 
6           return (u_agent.indexOf('trident/')>-1&&u_agent.indexOf('rv:')>-1);                  
7     }
8 }
原文地址:https://www.cnblogs.com/wuln/p/6232799.html