-1

I've read many questions and answers such as Check for IE 10, How do I target only Internet Explorer 10 for certain situations like Internet Explorer-specific CSS or Internet Explorer-specific JavaScript code?, How do I detect IE10 using javascript?, Best way to check for IE less than 9 in JavaScript without library, and above all Detect IE version (prior to v9) in JavaScript, etc.

Most of them use Javascript, jQuery (but 1.9+ doesn't seem to support $.browser anymore...), and adding a special class to <html> when IE <= 10 is used, allowing specific handling with CSS.

I want to do something simpler : have the HTML page display "Browser not supported" only and nothing else when IE <= 10 is used (i.e. the rest of the page should be hidden).

What's the recommended way to do that?

Community
  • 1
  • 1
Basj
  • 41,386
  • 99
  • 383
  • 673

1 Answers1

1

you want only display it when the version of I.E below I.E 10 right? I've thinking something like this :

<!--[if lt IE 10]>
    <script type="text/javascript">
        document.location.href="asd.html";
    </script>
<![endif]-->

this method is called "conditional comment" which only run things inside the comment tag only when it meet the I.E version condition. You can change content/rule inside that tag the way you want. I Recommend you to use this 'conditional comment' method. you can find more about that in here or here

and i've attach some simple example rule to redirect the page to another page, and you can write your 'browser not suported' message in that another page.

note: put that conditional comment inside 'head' tag.

  • i hope this help.
DikaDikz
  • 102
  • 1
  • 11