stopping the looping
by "Lady Wistfulee" <wistfulee(at)hawaii.rr.com>
|
Date: |
Tue, 4 Jan 2000 04:07:24 -1000 |
To: |
<hwg-techniques(at)hwg.org> |
|
todo: View
Thread,
Original
|
|
Hi O Learned ones,
After looking many scripts, ranging from simple to "no way I could =
comprehend it", I came up with something that does redirect browsers to =
the page I want them to go to, but it keeps looping.
This is what I came up with:
<script language=3D"JavaScript">
function whatBrowser()
{ var browserName =3D navigator.appName;
browserVer =3D parseInt ( navigator.appVersion );
name =3D "0";
if ( browserName =3D=3D "Netscape" && browserVer >=3D 4.7 ) name=3D"1";
if ( browserName =3D=3D "Microsoft Internet Explorer" && browserVer =
>=3D4 ) name=3D"2";
if ( browserName =3D=3D "Netscape" && browserVer < 4.7 )name=3D"3";
if ( browserName =3D=3D "Microsoft Internet Explorer" && browserVer <4 =
)name=3D"4";
if ( browserName !=3D "Microsoft Internet Explorer" && browserName !=3D =
"Netscape") name=3D"5";
if ( browserName =3D=3D "Opera" ) name=3D"6";=20
if (name =3D=3D "1")
location.href=3D(http://everythingemail.tripod.com/hoaxes.html");
if (name =3D=3D "2")
location.href=3D("http://everythingemail.tripod.com/hoaxes.html");
else
if (name =3D=3D "3")
location.href=3D("http://everythingemail.tripod.com/vanilla.html");
else
if (name =3D=3D "4")
location.href=3D("http://everythingemail.tripod.com/vanilla.html");
if (name =
=3D=3D"5")location.href=3D("http://everythingemail.tripod.com/vanilla.htm=
l");
else
if (name =3D=3D "6")
location.href=3D("http://everythingemail.tripod.com/vanilla.html");
}
</script>
I had figured to put this script in the head with a body onLoad =
function...changing the URL from "hoaxes" to whatever page I was on, but =
the browser is directed to the page it is already on, so it's looping. =
(In an odd way I am at least glad it works somewhat <S>) How can I tell =
it to just stay where it is & stop trying to reload the page again & =
again?
I want to use this script on every page...just changing the URL for the =
updated browsers, or a reasonable facsimile of this.
Needless to say...the page in question is at: =
http://everythingemail.tripod.com/hoaxes.html=20
Also...for a <noscript> tag for non-script-enabled browsers...I do want =
this to be the first thing right after the initial BODY tag...or do I =
not?
Any help as always very much appreciated!
(This is what I get for trying to do this myself!)
much alohas from Oahu ...
Lady Wistfulee
--"Tell me and I forget.=20
Show me and I remember.=20
Involve me and I learn."=20
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA