In many cases, we generally use navigator.useragent and regular expressions to determine the IE browser version, the following introduction to use IE browser different characteristics to determine IE browser
1 to judge IE browser and non IE browser
IE browser and non IE browser is the difference is that IE browser support activexobject, but not IE browser does not support ActiveXObject. When the IE11 browser has not yet appeared, we judge ie and non ie often write this
function Isie () {return
window. ActiveXObject? True:false;
}
But in the IE11, the judgment returned is false, and I tested the following code in IE11
Alert (window. ActiveXObject);
Alert (typeof window. ActiveXObject);
The result is
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/script/
What is this for? Clearly ActiveXObject is there, how to typeof the result is indeed undefined. Who knows the result, tell me why? For God's horse?
The official website of Microsoft said the difference of IE11 's activexobject. Http://msdn.microsoft.com/en-us/library/ie/dn423948%28v=vs.85%29.aspx. But there is no explanation for the typeof. If we use the following code to detect, it's OK.
Alert ("ActiveXObject" in Window)//returns false under Ie11
This is what I don't understand. The "ActiveXObject" in Window returns True, and why did the previous decision that IE's code returned false in IE11? ask Daniel again for an explanation. Thank you for the following directly give a compatible IE11 to judge IE and non IE browser methods.
function Isie () {return
("ActiveXObject" in window);
}
Note that the prerequisite is that our program code does not cover ActiveXObject, there should be no program to do so. Oh.