[thelist] javascript redirect

mr dave squalid at libertysurf.co.uk
Wed Aug 23 14:03:11 CDT 2000


>From Erika:
{> I have finally decided to write a page that probably needs a redirect
> for Netscape.
> It seems like it would be simple, but I don't know how.
>
> I want Netscape users (all of them) to go one place,
> and everyone else to go some other place.  seamlessly.
>
> help?}

<mr dave replies>
This would involve checking the users info for what browser they are using,
then having those that have netscape to one URL and those that don't to
another URL.
This is one way to do it:

<script language="JavaScript" type="text/javascript">
if ((navigator.appVersion.charAt(0) == "4")
||(navigator.appVersion.charAt(0) == "5")) {
 if (navigator.appName == "Netscape")
  browser="netscape";
 if (navigator.appName != "Netscape")
  browser="others";
}

if (browser == "netscape") {
window.location.href="http://netscapepageurlhere";
}

if (browser == "others") {
window.location.href="ie.html";
}
</script>

Hope that this is what you're after.
</mr dave replies>

-//mr.dave//-







More information about the thelist mailing list