Hello all,
I am brand new to coding javascript, and I am trying to code a redirect page based on the folder name. I have an IPlanet web server, and have begun to code this page. So far I have been able to split the URL based on the slashes '/'. Here is what code I have so far:
<HTML>
<BODY>
<script language="JavaScript" type="text/javascript">
<!-- hide from old browsers
var myURL, i, sheel;
myURL = document.URL;
document.writeln(myURL);
var myArray = myURL.split("/");
alert(myArray.length);
for(i = 3; i < myArray.length; i++)
{
document.writeln("<br> element is" + myArray + "<BR>");
document.writeln(myArray.length)
if (myArray.length > 3)
{
document.writeln(myArray.length)
document.writeln("<br>" + myArray[3])
}
else
{
document.writeln("<br>lets do something")
}
}
// -->
</script>
</BODY>
</HTML>
What I would like to do is take the folder name that the user is requesting, and redirect based on that. Any help is greatly appreciated.
Thanks,
Sheel
I am brand new to coding javascript, and I am trying to code a redirect page based on the folder name. I have an IPlanet web server, and have begun to code this page. So far I have been able to split the URL based on the slashes '/'. Here is what code I have so far:
<HTML>
<BODY>
<script language="JavaScript" type="text/javascript">
<!-- hide from old browsers
var myURL, i, sheel;
myURL = document.URL;
document.writeln(myURL);
var myArray = myURL.split("/");
alert(myArray.length);
for(i = 3; i < myArray.length; i++)
{
document.writeln("<br> element is" + myArray + "<BR>");
document.writeln(myArray.length)
if (myArray.length > 3)
{
document.writeln(myArray.length)
document.writeln("<br>" + myArray[3])
}
else
{
document.writeln("<br>lets do something")
}
}
// -->
</script>
</BODY>
</HTML>
What I would like to do is take the folder name that the user is requesting, and redirect based on that. Any help is greatly appreciated.
Thanks,
Sheel