Detect and Redirect IE 7 and older, to a page that requests them to download IE8 in order to view the page
Posted: 19 October 2009 08:35 PM   [ Ignore ]
Newbie
Rank
Total Posts:  1
Joined  2009-10-19

I’ve tried searching the site already, but this issue is somewhat too specific for the answer’s I’ve found.

I would like to include via CSS/HTML/JavaScript on my web-page, a way to detect if someone is not using IE 8 or equal (Firefox, Safari, etc.) and redirecting them to a page that tells them to download IE 8. Ideally this method would detect any CSS compatible browser, however, if it’s too difficult to do that…I would settle with just being able to detect if the user is using IE 7 or older, and requesting that they download IE 8 on a separate page.

I ultimately would not like them to view the page unless they have IE8 or equal.

I hope this makes sense.

Any ideas?

Thank You,
D

Profile
 
 
Posted: 02 May 2010 04:33 PM   [ Ignore ]   [ # 1 ]
Sr. Member
RankRankRankRank
Total Posts:  139
Joined  2010-04-23

On the client side you can use conditional compilation to detect the IE version. Use the following in a JavaScript block:

isIE8=@cc_on @_jscript_version == 5.8 ? true : false;
isIE7=@cc_on @_jscript_version == 5.7 ? true : false;
isIE6=@cc_on @_jscript_version == 5.6 ? true : false;
isIE55=@cc_on @_jscript_version == 5.5 ? true : false;

This requires JavaScript. To force a page not to be displayed unless then have IE you should do the check on the server side. This can be done by checking the user agent.
____________________
sudoku - social - puppies

Profile
 
 
Posted: 08 November 2010 12:33 AM   [ Ignore ]   [ # 2 ]
Jr. Member
RankRank
Total Posts:  39
Joined  2010-10-06

That will correctly force IE8 to render your site in IE8 mode,

Profile
 
 
Posted: 10 November 2010 10:07 PM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  14
Joined  2010-09-16
<!--[if lt IE 7]>
<
script type="src/JavaScript">
add a javascript here that will redirect your page
</script>
<![endif]--> 

This should work.
_________________________
jocuri cu masini - jocuri barbie

Profile
 
 
Posted: 26 February 2011 05:02 PM   [ Ignore ]   [ # 4 ]
Newbie
Avatar
Rank
Total Posts:  1
Joined  2011-02-26

Works for me too, thanks Alexandru Petru :)

Profile
 
 
Posted: 27 February 2011 10:49 AM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  20
Joined  2011-02-20

This is REALLY great!
Thanks everyone.

______________________________
Building Contractors Ireland
Ecommerce Agency

Profile