Best/good ways to alert users that they are using an old browser?

As the topic says:

Best/good ways to alert users that they are using an old browser?

I have built a site, supporting IE9 + , how would I best alert a user that enters the site on IE8 that they aint getting the full experience/seeing a “broken” site?

I don’t know Javascript but here’s food for thought. Perhaps try and see if the browser supports (recognizes) a function/feature in Javascript that’s only recognized in IE9+. If it’s not recognized, then you know it’s an older browser (IE8 down) and hten you can go from there.

// Redirect for IE Browsers
var IE = (!! window.ActiveXObject && parseInt(/msie\s(\d+)/i.exec(navigator.userAgent)[1])) || NaN;
// Compatibility Mode?
if(IE && /Trident\/(\d+)/i.exec(navigator.userAgent)[1]) IE = parseInt(/Trident\/(\d+)/i.exec(navigator.userAgent)[1])+4;
1 Like

There are already some scripts set up for this which do it it an unobtrusive way.

https://browser-update.org/
http://www.updateyourbrowser.net/en/

1 Like

IE Supports HTML Conditionals. This is the best way to handle old versions of IE.

If Less-Than or Equal-To IE 9

<!--[if lte IE 9]>
    <p>Please upgrade your browser, cause it's old as dirt and you should be ashamed.</p>
<![endif]-->

These work up to IE10. So you really could just say <!--[if IE]> and it would be the same thing.

This is a no-JS solution that is ignored by all other browsers because it’s read as a comment.

Handling it in JS or trying to handle old versions of other browsers means you need to start parsing the UA. You don’t want to parse the UA. It’s inaccurate and pretty much a waste of time because most people are not using old versions of Firefox or Chrome because they both have been auto-updating for a few years now. If someone intentionally disabled that, then it’s their own fault and there’s no reason you need to run code for every one of the 99.999% of your other visitors to handle these people.

Yes of course if only IE browsers are the issue then that’s an easy way to handle them (and I meant to mention that :blush: ). (It would also be nice to put a link to newer browser versions in the message and to a page that explains why they should update etc…)

Of course there are other old browsers out there that may have a problem and so it would seem logical to give them a message also. Even when dealing with just IE it would be nice to give the users a choice to remove/ignore the message which would once again require js…

The scripts I pointed to are quite nice and unobtrusive in that the messages can be removed if the the user so wishes.

I’ve always been on the fence about telling users to upgrade as there’s never really a nice way to tell someone they have an old browser as they may have no choice in what they use. :smile: These days though it does seem as though its completely acceptable to push to upgrade whereas in the past it used to be viewed as a bad move.

IE9 and earlier also support JScript conditionals so that you can put the tests directly in the JavaScript.

Also IE8 and earlier do not recognise the correct JavaScript MIME type of “application/javascript” and so will not run the JavaScript at all.

The way I read your OP is “How do I tell a user they have an old browser?” vs “How do I detect if a user has an old browser?”

Assuming the former, I would NOT use an obnoxious pop-up window - the world has enough of that junk as it is!

Why not place a distinct, yet settle message in maybe 9-pt red normal font near your top header that says:

The hyperlink could take user to a page with a listing of the latest browsers for each browser type.

That is how I would do it.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.