dynamicwebguy
Programmer
Hey --
I need some help with a script I'm making for my site. I'm trying to make a javascript dropdown link menu, that can open links in both the parent window and a new window as needed -- i.e. links to other pages on my site open in the same window, whereas links to sponsor sites will open in a new window.
I have it "kinda" working (see below script), but when you click on the sponsor link not only does it open in a new window, but also in the parent window simultaniously. Can someone help fix it?
<SCRIPT LANGUAGE="JavaScript">
<!--
function OpenPartner(list) {
var newPage = list.options[list.selectedIndex].value
if (newPage != "None" {
location.href=newPage
}
if (newPage == " {
window.open(newPage)
}}
//-->
</SCRIPT>
<FORM>
<SELECT onChange="OpenPartner(this)">
<OPTION VALUE="None">------ Select ------
<OPTION VALUE="<OPTION VALUE=" Interfaces
<OPTION VALUE=" 1
<OPTION VALUE=" 2
</SELECT>
</FORM>
You can see the working sample on one of the pages of my site at
Thanks in advance for the help.
-- Dave, dynamicnet
I need some help with a script I'm making for my site. I'm trying to make a javascript dropdown link menu, that can open links in both the parent window and a new window as needed -- i.e. links to other pages on my site open in the same window, whereas links to sponsor sites will open in a new window.
I have it "kinda" working (see below script), but when you click on the sponsor link not only does it open in a new window, but also in the parent window simultaniously. Can someone help fix it?
<SCRIPT LANGUAGE="JavaScript">
<!--
function OpenPartner(list) {
var newPage = list.options[list.selectedIndex].value
if (newPage != "None" {
location.href=newPage
}
if (newPage == " {
window.open(newPage)
}}
//-->
</SCRIPT>
<FORM>
<SELECT onChange="OpenPartner(this)">
<OPTION VALUE="None">------ Select ------
<OPTION VALUE="<OPTION VALUE=" Interfaces
<OPTION VALUE=" 1
<OPTION VALUE=" 2
</SELECT>
</FORM>
You can see the working sample on one of the pages of my site at
Thanks in advance for the help.
-- Dave, dynamicnet