views:

690

answers:

14

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.

+5  A: 

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.

Dave Markle
The irony of a jQuery site telling a jQuery capable browser that its unsupported....
jwsample
The older browsers cause minor issues which we do not need reported as "bugs" so here we go get rid of the old browsers.
Thqr
Turning a minor bug in to a giant gaping show-stopping bug in the process.
jwsample
Not really it is fairly simple and is as we present it. "No support whatsoever for browsers less than IE7"
Thqr
We need to find a way of causing a mild electric shock to run through the keyboard, too.
Dave Markle
Excluding people is not making the web a better place.
Tim Down
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
Thqr
+1  A: 

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.

Derek Greer
It's not his site that has compatibility problems. It's IE that has the problem.
Rob
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.
Derek Greer
+2  A: 

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

Sruly
+11  A: 

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

SQLMenace
good point......
Yassin
You know it's sad, but true.
alex
Good point, but doesn't answer the question at all. If he wants to turn away a bunch of users...cool for him.
JasCav
As I said this is not the case.. It is a web app built on javascript and jquery so if they dont have that then it won't work anyway. It is a REST / HTML design. So this is not an answer or solution to my question.
Thqr
Okay so I have IE7 with JavaScript and without admin rights..what am I supposed to do? I can't install any of the browsers that you want me to install
SQLMenace
You will have admin rights that is a given. The scenario is not the question.
Thqr
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
Steve Obbayi
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.
Thqr
i feel like running into a wall face first
James
-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.
Andrew Heath
-1 You are not answering his question
Dusty Roberts
+16  A: 

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

Gert G
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
Nice simple solution thankyou.
Thqr
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)
Carson63000
also, if your app requires javascript to work, make the body `display:none` and just remove it by jQuery.
Reigel
Onload it displays a login page. This says javascript must be enabled. And has local checks also for your login status. So If you dont have it enabled it won't let you login and the message will be stuck in your face so that part is covered :)
Thqr
+2  A: 
<html>
<head>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"&gt;&lt;/script&gt;
    <script>
        $(document).ready(function() {
            if ( $.browser.msie && $.browser.version < 8) {
              $('body').html( 'your browser is outdated' );
            }
        });
    </script>
</head>

<body>

</body>

</html>
Brandon Boone
Thankyou for actually answering the question rather than going NAR you can't do that like everyone else ^^
Thqr
My pleasure, need anything else or is this good enough for you?
Brandon Boone
Its good its good nice and simple approach.
Thqr
A: 

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.

Matthew Flaschen
It comes down to the fact that we do NOT want them using lower than IE7..
Thqr
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
@Rob as would I as would I.
Thqr
@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.
Matthew Flaschen
@Matthew Flaschen - Don't be offended. I was just twisting the dagger a little more.
Rob
+12  A: 

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");
}
karim79
Like the alert message :)
Thqr
*keylogger spycambotware*? +1 !
alex
spycambotware :D lolz
Rakesh Juyal
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.
Marco Demajo
+4  A: 

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 == false) {
$(['<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:

<p>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.</p>
<p>Fear Not!  There are two simple options available to you.  You can
either download <a href="http://www.mozilla.com/firefox/ie.html"
style="color:#900;">Firefox</a>, Google's
<a href="http://www.google.com/chrome" style="color:#900;">Chrome</a>,
or another standards compliant browser, or you can install a quick
and painless plugin from Google called
<a href="http://code.google.com/chrome/chromeframe/"&gt;Google Chrome
Frame</a>.</p>
<p>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.</p>
Stephen
<3 the description thanks for staying on topic :)
Thqr
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
+1 for the `iesucks` variable -.- awesome name ;)
Necros
+2  A: 

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

gnibbler
Standards won't help if IE doesn't support them.
Alexander
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.
Thqr
@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
gnibbler
TBH if it was up to me it would be warning users to not use IE alltogether :)
Thqr
+1  A: 

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.

Lunatik
I like the idea of that but in this case I want to refuse access.
Thqr
+2  A: 

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.

Fredrik_jakob
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.
Fredrik_jakob
Yes a little offtopic but fair points you weren't just going IE6 nazi. But yes basically my user base doesn't matter they WILL be able to upgrade ^^
Thqr
A: 

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 ;)

pferdefleisch
+1  A: 

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!"

rochal
I don't really see crashing it as graceful but agree on the "time to update"
Thqr