Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect IE6, and show alert?

I'm trying to show an alert when a user using IE6 uses my site. I'm thinking something like this will work:

<!--[if IE 6]>
<script language="Javascript">
alert ("The year 2004 just called - they want their browser back!")
</script>
<![endif]-->

I'd test this but I don't have a Windows box I can use ATM. Is this the correct way to do it?

like image 605
sudo rm -rf Avatar asked Jan 20 '11 04:01

sudo rm -rf


People also ask

How do I know if I have Internet Explorer user agent?

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 IE6 and IE7?

The only 1 important difference is: IE6 is nothing but a huge pain for web-designers. IE6 must die! You have no idea how much a pain it is to design a website which works perfectly under Firefox and IE7,8 then find out it's totally broken under IE6, because IE6 is too dumb to compile the code....

What is IE6 and IE8?

IE6 (in non-quirks mode): You write CSS for the IE6 limitations (hacks upon hacks) and sleep poorly. IE8 (in IE8/non-quirks mode): You write CSS which is [generally] compatible with other modern browsers and have happier dreams :p~

What is an IE6 VM?

Microsoft Internet Explorer 6 (IE6) is a graphical web browser developed by Microsoft for Windows operating systems. Released on August 24, 2001, it is the sixth, and by now discontinued, version of Internet Explorer and the successor to Internet Explorer 5.


2 Answers

Yes, that works:

alt text

Of course, you could use something like this, which is a bit more friendly.

like image 128
thirtydot Avatar answered Sep 29 '22 15:09

thirtydot


This has already been answered but I really wanted to post something I did for this. My personal website, have configured a similar script:

  <!--[if lt IE 9]>
  <script type="text/javascript">
    location.replace("/ie/?next=/");
  </script>
  <![endif]-->

So whenever anyone with IE vesion less then 9, the browser redirects to this page.

like image 23
crodjer Avatar answered Sep 29 '22 16:09

crodjer