Detect if any kind of IE (MSIE) [duplicate]

Asked
Active3 hr before
Viewed126 times

7 Answers

duplicate
90%

This works for me to detect any Version of the IE 5-11 (Internet Explorer) (Aug/05/2014):, 5 Just FYI, as of August 2015, this is not working for me. Interestingly (annoyingly), navigator.appName is set to Netscape instead of Microsoft Internet Explorer. – ohio818 Aug 31 '15 at 13:42 ,MSIE tokens have been removed in Internet Explorer 11 and $.browser uses navigator.userAgent to determine the platform and it is removed in jQuery 1.9.,This is because each release of Internet Explorer updates the user-agent string.

This works for me to detect any Version of the IE 5-11 (Internet Explorer) (Aug/05/2014):

if (navigator.appName == 'Microsoft Internet Explorer' || !!(navigator.userAgent.match(/Trident/) || navigator.userAgent.match(/rv:11/)) || (typeof $.browser !== "undefined" && $.browser.msie == 1)) {
   alert("Please dont use IE.");
}
load more v
88%

I dont want to allow users to access my site with Microsoft Internetexplorer (ANY VERSION).,A very annoing thing: Internetexplorer >v10 doesn´t admit to be a InternetExplorer.,This is because each release of Internet Explorer updates the user-agent string.,This works for me to detect any Version of the IE 5-11 (Internet Explorer) (Aug/05/2014):

What i´ve found and tried so far:

if (navigator.appVersion.indexOf("MSIE") != -1) {
   alert("You use IE. That´s no good.");
}

or

if ($.browser.msie) {
   alert($.browser.version);
}
load more v
72%

I dont want to allow users to access my site with Microsoft Internetexplorer (ANY VERSION).,What I´ve found so far was to detect if it´s lower or equal version 10.,What i´ve found and tried so far:,A very annoing thing: Internetexplorer >v10 doesn´t admit to be a InternetExplorer.

What i´ve found and tried so far:

if (navigator.appVersion.indexOf("MSIE") != -1) {
   alert("You use IE. That´s no good.");
}
load more v
65%

using conditional comments is a lot easier, is’nt it?,The problem with conditional comments is that IE 10 no longer supports them, Musa Permalink to comment# June 1, 2014 Conditional compilation was removed in IE11 , ajay Permalink to comment# September 2, 2013 but conditional comments is not working in ie 10

<script type="text/javascript">

if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 if (ieversion>=8)
  document.write("You're using IE8 or above")
 else if (ieversion>=7)
  document.write("You're using IE7.x")
 else if (ieversion>=6)
  document.write("You're using IE6.x")
 else if (ieversion>=5)
  document.write("You're using IE5.x")
}
else
 document.write("n/a")

</script>
load more v
75%

Legacy Internet Explorer and attachEvent (MDN),Yes, I know that programming pros prefer sniffing out feature-support instead of browser-type but I don't feel this approach makes sense in this case. I already know that all (relevant) non-IE browsers support the features that I need and that all pre-v9 IE browsers don't. Checking feature by feature throughout the site would be a waste.,   user-agent  -  internet-explorer  -  JavaScript  -  browser-detection ,Yes, I know that users can forge their useragent string. I'm not concerned.

I want to bounce users of our web site to an error page if they're using a version of Internet Explorer prior to v9. It's just not worth our time and money to support IE pre-v9. Users of all other non-IE browsers are fine and shouldn't be bounced. Here's the proposed code:

if (navigator.appName.indexOf("Internet Explorer") != -1) { //yeah, he's using IE
   var badBrowser = (
      navigator.appVersion.indexOf("MSIE 9") == -1 && //v9 is ok
      navigator.appVersion.indexOf("MSIE 1") == -1 //v10, 11, 12, etc. is fine too
   );

   if (badBrowser) {
      // navigate to error page
   }
}
load more v
40%

Estoy intentando usar esta línea para detectar el tipo de navegador: IE o Firefox. , Chrome devuelve "Esto es Internet Explorer" - IHeartAndroid , "msieversion ()> = 0" debería leer "msieversion> 0." De lo contrario, todos los navegadores devolverán "Esto es Internet Explorer". - as de la aviación , funcionará solo para IE 10 y versiones anteriores. Revisalo aquí. - Alex.K.

Estoy intentando usar esta línea para detectar el tipo de navegador: IE o Firefox.

alert(isBrowser("Microsoft"));
load more v
22%

// Internet Explorer 6-11
const isIE = !!document.documentMode;
load more v

Other "duplicate-undefined" queries related to "Detect if any kind of IE (MSIE) [duplicate]"