JS判断是否为IE浏览器 包含了IE11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> </HEAD> <script type="text/javascript" src="1.2.6.jquery.min.js"></script> <script type="text/javascript"> function isIE() { //ie? if (!!window.ActiveXObject || "ActiveXObject" in window) return true; else return false; } $(function() { alert(isIE()); }); </script> <body> </body> </HTML>
其实就是一个函数:
function isIE() { //ie? if (!!window.ActiveXObject || "ActiveXObject" in window) return true; else return false; }
本文来自博客园,作者:aspirant,转载请注明原文链接:https://www.cnblogs.com/aspirant/p/3618814.html