Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Internet Explorer and display a message

I have been looking around and cannot find what I am looking for

I want to display a warning to IE users that my website does not support IE nor will it ever try to and that you should get a better browser.

How you detect IE is really all I need but it would be nice if someone told me how to trigger a lightbox on the page but I can do that myself if you don't include it

Thank's for the help!

like image 313
b2550 Avatar asked Jan 27 '13 05:01

b2550


People also ask

How do I find Internet Explorer browser?

To detect whether the current browser is Internet Explorer, you can make use of the navigator. userAgent property. The userAgent property returns the value of the user-agent header sent by the browser to the server. It contains information about the name, version, and platform of the browser.

What is IE in HTML?

This method allows you to use simple code in your HTML to detect Internet Explorer (IE). You can determine whether or not the end user is using IE, and if so, which version. This allows you to provide content based on which browser is being used.

How do I know if I have IE11?

Use !( window. ActiveXObject) && "ActiveXObject" in window to detect IE11 explicitly. To detect any IE (pre-Edge, "Trident") version, use "ActiveXObject" in window instead.


1 Answers

Conditional HTML comments will work for detecting IE9 or less. From the HTML5 Boilerplate, which I highly suggest you use:

<!--[if lt IE 7]>
    <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
like image 115
elclanrs Avatar answered Oct 07 '22 07:10

elclanrs