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?
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.
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....
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~
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.
Yes, that works:
Of course, you could use something like this, which is a bit more friendly.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With