hey guys, i’ve asked a question on the css forum and got great responses so here’s one on javascript.
i’ve been searching the net for a while for a javascript redirect so that i can redirect IE6 browsers to a page that asks them to update. i’m sure i’m not alone on here in wishing that all ie6 users would just update finally, but they haven’t yet. i’m also sure that i’m not alone in discovering that my site looks fine on all browsers but this one.
so my question is this, what’s wrong with my code? i found a few and this one seems to work best but it redirects IE7 as well. my code is this:
<script LANGUAGE=“JavaScript”>
function browser_check()
{
var name = navigator.appName;
var version = parseInt(navigator.appVersion);
go(name, version)
}
function go(name, version)
{
if(name == “Microsoft Internet Explorer” && version <=6)
{
location.href=“redirected url”
}
}
</script>
it redirects ie 6 and ie 7, but i only want it to redirect 6 and lower. why is my “less than or equal to” not working properly?
thank jimmy, i’ve read through that and i hate to be this guy, but i’m really not versed well enough in javascript to interpret what they’re saying and then implementing it into reality.
with the code i’ve got now, it’s all working except for the browser version check. if i could just get that one bit sorted out…