Hey all,
I'm using the following script to detect the users browser and then redirect after a few seconds to a javascript or non-javascript page. (The javascript I used only works in IE)
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
redirTime = "2500";
redirURL = "frameset_a.htm"; //with javascript version of menu - ie compatible
redirURL2 = "frameset_b.htm"; //with non-javascript version of menu
// End-->
</head>
<body onLoad="redirTimer()">
<script language="Javascript">
<!-- Hide script from old browsers
if (navigator.appName == "Microsoft Internet Explorer") {
function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); }
}
else {
function redirTimer() { self.setTimeout("self.location.href = redirURL2;",redirTime);
}
}
// End hiding script from old browsers -->
</script>
</body>
It's always loading the non-javascript page, whether I am in IE or another browser. Why can't it detect IE? Did I write something wrong in that line of script? I have never done browser detection before so any help would be appreciated.
Thanks,
geminian
I'm using the following script to detect the users browser and then redirect after a few seconds to a javascript or non-javascript page. (The javascript I used only works in IE)
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
redirTime = "2500";
redirURL = "frameset_a.htm"; //with javascript version of menu - ie compatible
redirURL2 = "frameset_b.htm"; //with non-javascript version of menu
// End-->
</head>
<body onLoad="redirTimer()">
<script language="Javascript">
<!-- Hide script from old browsers
if (navigator.appName == "Microsoft Internet Explorer") {
function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); }
}
else {
function redirTimer() { self.setTimeout("self.location.href = redirURL2;",redirTime);
}
}
// End hiding script from old browsers -->
</script>
</body>
It's always loading the non-javascript page, whether I am in IE or another browser. Why can't it detect IE? Did I write something wrong in that line of script? I have never done browser detection before so any help would be appreciated.
Thanks,
geminian
Comment