Internet Explorer discovery and message display

I look around and can't find what I'm looking for.

I want to show IE users a warning that my site does not support IE and it will never try, and that you should get a better browser.

As you discover IE, really all I need is, but it would be nice if someone told me how to run a lightbox on a page, but I can do it myself if you don't turn it on.

Thanks for the help!

+5
source share
4 answers

HTML conditional comments will work to detect IE9 or less. From the HTML5 Boilerplate , which I highly recommend 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]-->
+15
source

try it

 if ($.browser.msie) {
    // you are using IE
 }

: jquery.browser

+1

navigator , .

navigator.userAgent provides browser related information.

JS snippet:

<script>
  var x = navigator.userAgent;
  alert(' browser details ' + x);
</script>

The links below will tell you more about this in more detail:

http://www.javascriptkit.com/javatutors/navigator.shtml

+1
source

Paste the code after the tag:

  <!--[if lt IE 8]>
  <p class="browserupgrade">Vous utilisez un <strong>ancien navigateur</strong>. Mettez votre <a href="http://browsehappy.com" target="_blank">navigateur à jour</a> dès aujourd'hui !</p>
  <![endif]-->

PS: edit the content as needed. I translated it into French for my own use.

0
source

All Articles