Detect IE7 and below

What is the best way programmatically on a web page (using jquery / javascript / html / asp.net / css something real) to display a message for users of IE 7 and below?

I decided that the site does not support these browsers (the target audience of the site is quite technically updated), so I would like to show the notification bar at the top of the page that says the pages may not display correctly.

+3
source share
6 answers
+5
source
+3
source

" " - .

<!--[if lte IE 7]>
<div class="info">Message saying you're sorry.</div>
<![endif]-->
+2

JavaScript Navigator

if((navigator.appName != 'ie') && (navigator.appVersion <= 7))
{
    alert('Incompatible Browser')
}

, , . - W3Schools

+2

script. CSS . CSS, , .

+1

, , IE, , Modernizr, , , .

The advantage of this is that it will also pick up users of truly old versions of other browsers (yes, there are still a few). Even some relatively recent mobile phone browsers can give you problems.

Another advantage of this method is that it will also be easier to adapt the script to include other necessary functions when you improve the site in the future.

+1
source

Source: https://habr.com/ru/post/1795743/


All Articles