JavaScript in Netscape
I am running this script as a dummy login application:
<script>
function getit() {
if (document.former.IDS.value == "crosby") {location.replace('crosby/profile.html')}
else if (document.former.IDS.value == "sample"){location.replace('sample/profile.html')}
else if (document.former.IDS.value=="drest"){location.replace('drest/profile.html')}
else if (document.former.IDS.value=="east"){location.replace('east/profile.html')}
else if (document.former.IDS.value=="noonan"){location.replace('reporting/profile.html')}
else {location.replace('errorlogin.html')}
}
</script>
It works fine in IE but keeps reloading the same page when I attempt it in Netscape. What could be the problem?
Vincent Puglia posted this at 14:34 — 13th September 2001.
They have: 634 posts
Joined: Dec 1999
Hi,
Not knowing what you mean by "the same page"....
if else clauses occasionally cause browser confusion. So, kill the braces around the 'location.replace...' code and place them around the 'else's:
if (document.former.IDS.value == "crosby")
location.replace('crosby/profile.html')
else
{
if (document.former.IDS.value == "sample")
location.replace('sample/profile.html')
else
{
if (document.former.IDS.value=="drest")
location.replace ('drest/profile.html')
.....etc....
}}}}
Vinny
Where the world once stood
the blades of grass cut me still
Jack Michaelson posted this at 17:39 — 13th September 2001.
He has: 1,733 posts
Joined: Dec 1999
Hey Vinny welcome back!
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.