Guest_imported
New member
- Jan 1, 1970
- 0
Hi, I'm a begginner I am struggling with the following.
I am trying to use the below code to navigate within my site. However when I replace the url for the external links with relative urls from my site eg. "main.htm" I get an error
<SCRIPT>
<!--
function redirect(pulldown) {
newlocation = pulldown[pulldown.selectedIndex].value;
if (newlocation != ""
self.location = newlocation;
}
function resetIfBlank(pulldown){
possiblenewlocation = pulldown[pulldown.selectedIndex].value;
if (possiblenewlocation == ""
pulldown.selectedIndex = 0; /* reset to start since no movement */
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="navForm">
<B>Favorite Sites:</B>
<SELECT NAME="menu" onChange="resetIfBlank(this)">
<OPTION VALUE="" CLASS="nochoice" SELECTED> Choose your site
<OPTION VALUE="" CLASS="nochoice">
<OPTION VALUE="" CLASS="nochoice">Search Sites
<OPTION VALUE="" CLASS="nochoice">------------
<OPTION VALUE=" CLASS="choice">Yahoo!
<OPTION VALUE=" CLASS="choice">HotBot
<OPTION VALUE=" CLASS="choice">Google
<OPTION VALUE="" CLASS="nochoice">
<OPTION VALUE="" CLASS="nochoice">E-commerce
<OPTION VALUE="" CLASS="nochoice">------------
<OPTION VALUE=" CLASS="choice">Amazon
<OPTION VALUE=" CLASS="choice">Buy.com
<OPTION VALUE="" CLASS="nochoice" CLASS="choice">
<OPTION VALUE="" CLASS="nochoice">Demos
<OPTION VALUE="" CLASS="nochoice">------------
<OPTION VALUE=" CLASS="choice">DemoCompany
</SELECT>
<INPUT TYPE="button" VALUE="go"
onClick="redirect(document.navForm.menu)">
</FORM>
<SCRIPT>
<!--
document.navForm.menu.selectedIndex = 0;
//-->
</SCRIPT>
I am trying to use the below code to navigate within my site. However when I replace the url for the external links with relative urls from my site eg. "main.htm" I get an error
<SCRIPT>
<!--
function redirect(pulldown) {
newlocation = pulldown[pulldown.selectedIndex].value;
if (newlocation != ""
self.location = newlocation;
}
function resetIfBlank(pulldown){
possiblenewlocation = pulldown[pulldown.selectedIndex].value;
if (possiblenewlocation == ""
pulldown.selectedIndex = 0; /* reset to start since no movement */
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="navForm">
<B>Favorite Sites:</B>
<SELECT NAME="menu" onChange="resetIfBlank(this)">
<OPTION VALUE="" CLASS="nochoice" SELECTED> Choose your site
<OPTION VALUE="" CLASS="nochoice">
<OPTION VALUE="" CLASS="nochoice">Search Sites
<OPTION VALUE="" CLASS="nochoice">------------
<OPTION VALUE=" CLASS="choice">Yahoo!
<OPTION VALUE=" CLASS="choice">HotBot
<OPTION VALUE=" CLASS="choice">Google
<OPTION VALUE="" CLASS="nochoice">
<OPTION VALUE="" CLASS="nochoice">E-commerce
<OPTION VALUE="" CLASS="nochoice">------------
<OPTION VALUE=" CLASS="choice">Amazon
<OPTION VALUE=" CLASS="choice">Buy.com
<OPTION VALUE="" CLASS="nochoice" CLASS="choice">
<OPTION VALUE="" CLASS="nochoice">Demos
<OPTION VALUE="" CLASS="nochoice">------------
<OPTION VALUE=" CLASS="choice">DemoCompany
</SELECT>
<INPUT TYPE="button" VALUE="go"
onClick="redirect(document.navForm.menu)">
</FORM>
<SCRIPT>
<!--
document.navForm.menu.selectedIndex = 0;
//-->
</SCRIPT>