views:

2008

answers:

8

I want to warn users of Internet Explorer 6 using my site, that IE6 has had serious compatibility issues with my site in the past. What is the best way to do this?

Ideally, I want to have a message appear (not a new window, but a message box, if possible) that warns IE6 users of the issues and reccommends they update to either IE7, Firefox 3 or Opera 9.5.

+2  A: 

My suggestion would be to fix your site ;) No seriously, I would use a small banner on top of the page, like the small unobtrusive dialogs in Firefox and IE. Not a messagebox or something that would actually interfere to much.

chriscena
+14  A: 

The best way to target IE is through the use of conditional comments. You can then add some specific HTML that will only display in Internet Explorer.

<!--[if IE 6]>
<h1>Please upgrade your browser!</h1>
<![endif]-->

More on the subject:

http://www.quirksmode.org/css/condcom.html

different
+4  A: 

Conditional comments provide a way of only displaying content for specific versions of Internet Explorer.

<!--[if IE 6]>
Special instructions for IE 6 here
<![endif]-->
dave
+1  A: 

My advice is not to use a popup window or a message box. They are very annoying and make for a bad user experience. Better insert some <div> with the notice and make it stand out from the rest of the page. Don't overdo it, just assign it some colours that makes sure it is not overlooked (and please: Don't use <blink> ;-)

Treb
I hate <blink> all it does is distract people.
Iwasakabukiman
+2  A: 

Although telling users to update their browsers and them actually doing it would be great it really isn't going to happen. If the user hasn't upgraded their browser by now there is normally a reason for it, lack of computer knowledge or no control over the computer itself. For example employees browsing your site on work machines.

I really think you should reconsider fixing the issues that your users will have or consider progressive enhancements. The idea is that the basic functionality of your website works in every browser, then any extra functionality is developed so that it is only visible / useable on browsers that can support it.

John_
+1  A: 

If you want to determine if it's anything other than support browsers, you might want to use jQuery's browser detection, something like:

<script type="text/javascript">
// check if browser is IE6 (when IE) or not FF6 (when FF)
if (($.browser.msie && $.browser.version.substr(0,1) == '6')
    || ($.browser.mozilla && $.browser.version.substr(0,1) != '3')) {
        $('#browserWarning').show();
}
</script>

Update: As different said, a much better option is to use the IE if statements, such as:

<style type="text/css">
/* this would probably be in a CSS file */
#browserWarning { display:none; }
</style>
<!--[if IE 6]>
<style type="text/css">
#browserWarning { display:; }
</style>
<![endif]-->

This option is much better because it doesn't require the browser version to "perfect". This won't work though, if you want to detect other browsers as they don't support the if statements. Then you may want to use jQuery to detect the browser, although I would recommend trying to avoid it as much as much as possible.

Another great idea (or joke) is ie6update.com. It's not exactly what you want, but it wouldn't be hard to modify to make it display another message.

Darryl Hein
but that's not going to be compliant with IE version 60 through 69!
nickf
Thanks for the help. Much appreciated.
Iwasakabukiman
@nickf: why won'y it work with IE 60 through 69? It only takes the first character of browser version...so 6
Darryl Hein
2 things wrong with that implementation. You are specifically testing for IE6 instead of IE < 7 and your notion of parsing the version is broken which is what nickf was referring to.It would be better if you parsed the version as an int or a float (`if (parseInt($.browser.version) < 7) { ... }`). Your current implementation detects IE version 60 through 69 as version 6. Opera version 10 is in alpha and it is already seen the pitfalls of (bad) browser detection as people detect version 10 as version 1.http://my.opera.com/Andrew%20Gregory/blog/2008/05/11/opera-10-is-too-old
fearphage
A: 

Ok, I'll make this easy. No popups! A statistical disaster. Here is a nice little that sits on top of the . I only really worry about IE 6 or earlier since its the biggest culprit when it comes to messign up my designs. Below is a conditional statement (the best way to go in my opinion).

Stick this in the head (put in whatever content you wish):

ad53c39a64316c67ea21ca7cc4d182aa

Stick this in your external styling sheet. I would not use inline styling.

warning {position:relative; top:0px; width:100%; height:40px; background-color:#fff; margin-top:0px; padding:4px; border-bottom:solid 4px #000066}

Style it however you want - go nuts! You can get very specific with java to detect any browser, so if ya know how, it can add greater specificity.

This will be a pretty little box that sits on top of your content and lets your users see that their browser sucks.

ok. i see not copy and pasting here then.
+1  A: 

There is a project called Push Up the Web which advises all users to upgrade to newer versions of their browsers. It is unobtrusive and easy to add.

As some have suggested, the best thing to do is use conditional comments to target IE effectively.

To the other commenters, with the release of IE8 (which effectively added 2 additional browsers to test: standards + compatibility mode), IE6 has run its course. It is time for those people to upgrade browsers and in some cases OSes/computers. IE6 is holding back the progression of the web. It's a drain in resources to support. It has reached Netscape 4 status. Major sites and companies are joining the battle as well.

And more reading:

http://www.bringdownie6.com/bring-down-ie-6.html
http://ripie6.com/
http://ie6.forteller.net/

fearphage