Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sk3pt1c

macrumors 6502a
Original poster
hi there, i've made a site that looks like crap on IE7 (of course),
so i'd like to detect ie7 and redirect to a page that tells users to
upgrade their browsers.
i know i can provide an alternate stylesheet for ie7 users, but for
this specific site, i'd like to just redirect to a page i've made with that
notification on it.
thanks 😀

also, for some reason, this:

Code:
<!--[if lte IE 7]<link rel="stylesheet" href="ie7.css"/>[endif]-->

doesn't seem to work...
 
right, tried various different methods, but the only one that worked is this:

Code:
<script language="JavaScript"><!--
if (navigator.userAgent.toLowerCase().indexOf('7.0') != -1) {
document.write("<link rel='stylesheet' href='ie7.css' type='text/css'>");
}

// --></script>
 
also, for some reason, this:

Code:
<!--[if lte IE 7]<link rel="stylesheet" href="ie7.css"/>[endif]-->

doesn't seem to work...

That's because IE sees that as a comment too. Try:

Code:
<!--[if lte IE 7][B]>[/B]<link rel="stylesheet" href="ie7.css"/>[B]<![/B][endif]-->
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.