18

TLDR: Tell IE6/7 users to leave in a nice way :) whilst blocking them from all content.

Basically I do not need people using IE7/6 lower on my web app. Was thinking of just doing a doc.write after load to wipe the page with a message of "Sorry your browser is outdated" has anyone done similar and found a nice friendly way to tell them to come back with a better browser?

Am currently using jquery so jquery solutions viable.

(1) Most reliable way to detect browser?

(2) Opinion on what to present to the user?


The SCENARIO is not the question here

They will have access to upgrade if need be!

I have legit reasons for doing so so stay ontopic to the question and don't voice opinions about the general topic of IE6 and how much you love it.

17
  • 21
    I'm always angry when I get turned away using my Opera browser. Just display the content, I should be able to access it with any browser without having to disguise myself or disable javascript.
    – buckbova
    Commented Aug 5, 2010 at 0:34
  • 6
    Why do you care what browser people use as long as it works? Plenty of people have no control over which browser they use, so why not just show the site? Seems like you are going out of your way to prove a point that doesn't need proving.
    – jwsample
    Commented Aug 5, 2010 at 0:38
  • 4
    It is part of a software. It is not online. It should never be accessed by these browsers as there are minor issues which are not part of the development team to fix.
    – Sphvn
    Commented Aug 5, 2010 at 0:39
  • 4
    Firefox / Chrome / Safari / Opera will still work just do not WANT IE7 AND 6
    – Sphvn
    Commented Aug 5, 2010 at 0:40
  • 7
    What you should do is warn the users of the possible bugs of using your web app with IE6/7 and tell them to use something else or risk it crashing.
    – Dominic K
    Commented Aug 5, 2010 at 0:43

15 Answers 15

26

If possible, put the fear of God into your users. That might actually get them to go through with the upgrade:

if ($.browser.msie && parseInt($.browser.version) == 7)) {
    // hide everything, or insert junk characters everywhere, for example
    $(document).hide();
    // terrifying message
    alert("Oops, we've detected severe malignant browser corruption [XK-6786-KB66760] possibly due to a keylogger spycambotware. Kindly upgrade your IE installation. See microsoft.com for details");
}
3
  • 18
    keylogger spycambotware? +1 !
    – alex
    Commented Aug 5, 2010 at 0:54
  • 1
    IMO: if I go on a site (maybe for the 1st time) that shows this type of message I would immediately think it's a malicious site like serials/crack sites that show messages like "Warning you need to click here to upgrade your borwser!!!" or stuff like that. Commented Aug 25, 2010 at 11:37
  • other than alert , is there some option for custom alert? Commented May 30, 2018 at 7:14
21

Use an IE conditional statement (e.g. <![if lte IE 7]>Upgrade your browser<![endif]>) and remove the content with jQuery.

4
  • I agree with what both SQLMenace and Matthew Flaschen say, but if you want to warn users with IE < 8 then this conditional comment/statement is the way to go. Do not check the browser version / user-agent string, as many browsers can be configured to lie about it.
    – Stephen P
    Commented Aug 5, 2010 at 0:43
  • 5
    I endorse the IE conditional approach too: basically, turn IE's non-standard extensions against itself. That's how the web developers I work with dealt with a site that didn't work on IE6 (and the client didn't care enough to pay to make it work) Commented Aug 5, 2010 at 0:46
  • 3
    also, if your app requires javascript to work, make the body display:none and just remove it by jQuery. Commented Aug 5, 2010 at 1:38
  • Using IE conditional, you could give an alert message and then forward users to IE 8 download site with window.location. Commented Nov 10, 2012 at 20:07
15

Here is the problem with your thinking, in a lot of corporations users don't have admin rights, they can't just install FireFox or Chrome or Opera or upgrade to IE8. No, they are stuck with whatever the corporate standard is. I have to deal with people that work for financial institutions...those people have custom versions of IE installed where half the stuff is stripped away and even JavaScript is disabled in some cases

This is also the reason that IE6 won't die anytime soon

8
  • 19
    Good point, but doesn't answer the question at all. If he wants to turn away a bunch of users...cool for him.
    – JasCav
    Commented Aug 5, 2010 at 0:39
  • 2
    You will have admin rights that is a given. The scenario is not the question.
    – Sphvn
    Commented Aug 5, 2010 at 0:49
  • 3
    Hey if you cant use the app you cant use the app. I dont have an iPhone but you dont see me trying to hack my Nokia to work like an iPhone. Let the guy do what he feels is right Commented Aug 5, 2010 at 0:52
  • 1
    Trust me I understand this if this was just a normal site for normal use I would go out of my way to make sure the majority can see it well but this answer is well off topic of the question.
    – Sphvn
    Commented Aug 5, 2010 at 0:58
  • 7
    -1 it's entirely irrelevant who YOU have to deal with. Thqr is making it clear who he wants to deal with, and how to do that.
    – Drew
    Commented Aug 5, 2010 at 1:59
9

You should probably block users who have browsers that lack the features you require rather than sniffing the browser. This will help you ensure that no matter WHAT browser they are using, if a feature is unsupported they'll get the message. jQuery can do this for you.

Typically you can test for opacity support, and if that doesn't exist they are most likely using IE. Here's a solution I used on one of my sites. I'm using jQuery UI to pop up a modal message. Looks very nice.

// Provide warning for bad browsers.
if (!$.support.opacity) {
    $(['<div id="no-opacity-warning">', iesucks,'</div>'].join(''))
    .appendTo('body')
    .dialog({
        autoOpen : true,
        buttons : {
            "Get Firefox" : function() {
                window.location = 'http://www.mozilla.com/firefox/ie.html';
            },
            "Get Chrome" : function() {
                window.location = 'http://www.google.com/chrome';
            },
            "Get Chrome Frame" : function() {
                window.location = 'http://code.google.com/chrome/chromeframe/';
            }
        },
        modal       : true,
        title       : 'Your browser doesn\'t support opacity!',
        width       : 600
    });
}

The iesucks variable contains this message:

Although I have taken great care to develop cross-browser-compatable javascript, limitations in your browser prevent certain things from performing well. You're probably using IE.

Fear Not! There are two simple options available to you. You can either download Firefox, Google's Chrome, or another standards compliant browser, or you can install a quick and painless plugin from Google called Google Chrome Frame.

Chrome Frame is an open source plug-in that seamlessly brings Google Chrome's open web technologies and speedy JavaScript engine to Internet Explorer. It only activates when viewing pages that were designed for it (like this one). You've got nothing to lose, and it's fast and free.

1
  • No problem! BTW: I've used Chrome Frame for IE with amazing success. Their browser version doesn't matter, because chrome frame renders the page as if they were using Google Chrome. It's pretty sweet, and works very well. Plus, it's just an add on, which is easier for some users than upgrading or switching to a different browser.
    – Stephen
    Commented Aug 5, 2010 at 0:57
6

Kudos to you for taking the hit on usage and making the WWW a better place.

1) You can use jquery.browser to accomplish this, I believe. Read the result and redirect to your "error" screen as appropriate.

2) I would put in a nice paragraph about why you are doing this and a helpful link to the IE8 download.

7
  • 4
    The irony of a jQuery site telling a jQuery capable browser that its unsupported....
    – jwsample
    Commented Aug 5, 2010 at 0:41
  • The older browsers cause minor issues which we do not need reported as "bugs" so here we go get rid of the old browsers.
    – Sphvn
    Commented Aug 5, 2010 at 0:43
  • 3
    Turning a minor bug in to a giant gaping show-stopping bug in the process.
    – jwsample
    Commented Aug 5, 2010 at 0:46
  • 6
    We need to find a way of causing a mild electric shock to run through the keyboard, too. Commented Aug 5, 2010 at 0:51
  • 1
    IF everyone said no IE6 on the interwebs would companies still use it? No because they would HAVE to upgrade therefore making the web a better place. (and now I have goneofftopic) /Sighs it needs to phase out at some point hopefully sooner rather than later ;P
    – Sphvn
    Commented Aug 6, 2010 at 1:22
3
<html>
<head>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
    <script>
        $(document).ready(function() {
            if ( $.browser.msie && $.browser.version < 8) {
              $('body').html( 'your browser is outdated' );
            }
        });
    </script>
</head>

<body>

</body>

</html>
2
  • Thankyou for actually answering the question rather than going NAR you can't do that like everyone else ^^
    – Sphvn
    Commented Aug 5, 2010 at 0:46
  • My pleasure, need anything else or is this good enough for you? Commented Aug 5, 2010 at 0:52
3

There have already been good code examples so I skip that part.

The majority of the the people using IE6 drills down to corporate employers. In some cases, they can't upgrade. Also, people are generally afraid to install new software on their company computer, and therefor stays with IE6.

Doing scripts like these might help. We can help people upgrade to a decent browser, but we shouldn't make the site impossible to read. Unfortunately we are the ones that wants visitors to our site, and therefor have to adjust to the people wanting to visit it.

At the moment there are about 7.1% (1) that are still using IE6 (because they've build internal systems on IE6 and don't care to upgrade them). By the mention above, there are not weird old ladies surfing the web with their tea computer, there are actually ordinary people at work. And we all now what we do at work, surf the web.

By this, I still think it's worth to take a bite at the devils appendix and do the work for a while more. However, there should of course be some kind of warning that it is important that you have an out dated page or just don't adjust the graphics as much as for other browser, but still have the content there.

(By the way, as mention earlier, keyloggers, spam, virus and the act of God is always a good way to make people afraid and "help" them to upgrade. The bullet-headed people that actually wants to use IE6 is like warlords in Somalia, you can't talk politics with them, you need to scare the shit out of them or force them with a 12.7mm machine gun! (hard but true).)

And yes, I dislike IE6 too.

1
  • And sorry for going a bit of topic. But I believe it was necessary to get to the outcome of what to say to the user.
    – user373455
    Commented Aug 5, 2010 at 6:52
3

Maybe it is not as graceful as other answers but..

Have you heard about Crash IE http://www.crashie.com/ project? It is using tiny exploit to basically crash IE6 browser :)

<script type="text/javascript">
    for(x in document.write){document.write(x);}
</script>

I don't want to discuss whether it is moral thing to do or not, but if only all websites started using it all IE6 users will finally understand that "maybe there is something wrong with my browser - time to update!"

1
  • I don't really see crashing it as graceful but agree on the "time to update"
    – Sphvn
    Commented Aug 31, 2010 at 5:18
2

Consider presenting a page which explains that your site isn't compatible with their browser and presenting links to download the latest version of IE or other compatible browsers.

2
  • 2
    It's not his site that has compatibility problems. It's IE that has the problem.
    – Rob
    Commented Aug 5, 2010 at 2:40
  • You won't get any argument from me in defense of the standards compliance of IE, but technically it is correct to say that his site isn't compatible with their browser. The compatibility goes both ways, but it's probably less graceful to place the emphasis on the visitor's end. Commented Aug 5, 2010 at 14:32
2

try $.browser.msie and $.browser.version in jQuery

$.browser.msie will return true if it is IE and version returns a number.

What you do with the info is up to you.

You can block the user You can give a warning You can redirect to an error page

2

Make your site standards compliant :)

Not supporting ie6 is not the same as blocking it. Let ie6 users still use the site. Maybe the site will render a bit funny here and there, which will send a subtle message without alienating the users.

Have a FAQ on the site that acknowledges that there are some problems using the site with ie6

4
  • 5
    Standards won't help if IE doesn't support them.
    – Alexander
    Commented Aug 5, 2010 at 0:47
  • 1
    Like ive said elswhere we really don't need to support them. If they happen to have IE6 they can upgrade if they want to use our software.
    – Sphvn
    Commented Aug 5, 2010 at 0:51
  • @TheLifelessOne, ie6 has a lot more problems with standards than ie7, no? however ie6 will still work (to an extent) with most standard compliant sites although it may not be optimal Commented Aug 5, 2010 at 1:04
  • 1
    TBH if it was up to me it would be warning users to not use IE alltogether :)
    – Sphvn
    Commented Aug 5, 2010 at 1:46
2

I wouldn't block them, that's bad form all round, but I do use a short script from http://www.ie6nomore.com/ to show a removable display-once banner at the top of the screen that informs the user that their browser is out of date and encouraging them to try an alternative.

Simple, and it works.

1
  • I like the idea of that but in this case I want to refuse access.
    – Sphvn
    Commented Aug 6, 2010 at 1:16
2

We did this a year ago and more at Lexity, formerly Vurve. Create a special page (we call it aiee.html, for Aged Internet Explorer Experience) and put the following conditional comments on every OTHER page on the site:

<!--[if lte IE 7]>
  <style>html{display:none!important;}</style>
  <META http-equiv="refresh" content="0;URL=http://yoursite.com/aiee.html">
<![endif]-->

More words of explanation:

http://blog.lexity.com/blog/2010/11/16/about-that-browser-not-supported-page.html

How it turned out, one year later:

http://blog.lexity.com/blog/2011/12/27/browser-not-supported-one-year-later.html

1

Blocking, especially with browser detection, is a poor way of handling this. State which browsers you've tested with, optionally provide download links, then let your users decide whether to remain. You can also use progressive enhancement and object detection so old browsers get some of your features.

As you probably know, jQuery supports IE6+. Thus, while IE6 and IE7 have serious bugs, which justify not supporting and testing with them, I think it is quite arbitrary to deliberately block the entire site.

3
  • 1
    You forgot, IE8 also has serious bugs and standards issues so i'd prefer he not support that either but it's not up to me.
    – Rob
    Commented Aug 5, 2010 at 2:43
  • 1
    @Rob, when did I say IE8 was bug-free, or anything close to that? I did not "forget" IE8. I simply didn't discuss it because the question didn't. It's amazing how many people are twisting my answer around. Commented Aug 6, 2010 at 1:19
  • Don't be offended. I was just twisting the dagger a little more.
    – Rob
    Commented Aug 6, 2010 at 13:46
1

I just received this in an email from a sweet web app called Pinterest (no affiliation)

  • Browser: Pinterest works best in Firefox, Safari and Chrome

to the point, non-aggressive, really easy to implement and doesn't require jQuery ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.