javascript - Is there a way to detect IE from IE8-IE11 without using user-agent? -


People,

Just upgrade from jQuery 1.8.3 to 1.11, browser Object 1.9 has been removed and with the decision user-agent is not recommended. But I still have to find out if the browser is IE or not, at a certain point in my code.

The conditional stylesheet is supported only with IE6-IE 9, I search and search and it only looks for user

Is there any way to do this? Is not using User-Agent and works from IE 8 to IE 11?

Text ">

"), that is, div.innerHTML = "& lt ;! - [If IE 5]> 5 & lt ;! [endif] - & gt; & Lt ;! - [If IE 5.0] & gt; 5 & ​​lt ;! [Endif] -> "+" & lt ;! - If [IE 5.5] & gt; 5.5 & lt ;! [AndIf] - & gt; & Lt ;! - [If IE 6] & gt; 6 & lt ;! [AndIf] - & gt; "+" & lt ;! - [If IE 7]> 7>! [AndIf] - & gt; & Lt ;! - [If IE 8] & gt; 8 & lt ;! [AndIf] - & gt; "+" & lt ;! - [If IE 9]> 9 & lt ;! [Andif] -> gt; if (div.firstChild & div.firstChild.nodeType === 3) ie = + div.innerHTML;

but it is IE10-11 Does not work because they do not support conditional comments, and IE11 neither in compatibility mode (and so type of waste - conditional comments have been used lot ). Edit: Fortunately, it has been decided that I answered it. Ah!

If you manage to find out your vendor You can check IE 10-11 for example:

  var prop, isIE = false; (for Sahara in div.style) (/ ^ ms [AZ] /.test(prop)} {isIE = true; break;}   

This works but you will not be able to tell IE10 from IE11 unless you have a UA string Or do not check some recent features.

But honestly, IE10 + is okay, and automatic updates should also be met. You should go for the detection of the feature for those people, and the version B Forget Ray.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -