This article mainly introduces how to determine whether Javascript is an IE browser (including IE10 and IE11). If you need it, you can refer to the following code copy function, ie11 does not support document either. all, it seems that the standard will become more and more standard in the future
Today, I encountered a strange problem: there is a page that I want to specify to open in IE browser. There is no problem in the VS development environment, but it is deployed on the server. Even if I open the page with IE, the prompt "only supports IE" is displayed. It's dizzy !!
Determine whether the IE browser uses window. navigator. userAgent, tracking this information, found in the development environment, identified as IE10, but access server is identified as IE11, but IE11 userAgent does not have the MSIE Mark, this is the reason.
Change the method of judging IE browser to the following.
Original Function Syntax: no longer supported for the new version of ie11
Function isIE () {if (window. navigator. userAgent. indexOf ("MSIE")> = 1) return true; else return false ;}
Ie10 and above does not support the judgment of IE browser, because ie11 does not support document. all, the following is the version of ie11 support, of course, ie6-8 is also supported
Function isIE () {// ie? If (!! Window. ActiveXObject | "ActiveXObject" in window) return true; else return false ;}