标签:
<script> if(!+[1,])alert("这是ie浏览器"); else alert("这不是ie浏览器"); </script> <script> //if(!+"\v1")alert("+"\v1"判断是IE浏览器"); //此方式未成功 </script> <script> if(!!(window.attachEvent && navigator.userAgent.indexOf(‘Opera‘) === -1)) alert("IE浏览器!"); </script> <script> if(!!(!window.addEventListener&& navigator.userAgent.indexOf(‘Opera‘) === -1)) alert("是IE浏览器!"); if(!!(document.all && navigator.userAgent.indexOf(‘Opera‘) === -1)) alert("是IE!"); </script>
标签:
原文地址:http://www.cnblogs.com/double405/p/4636069.html