Budda
04-01-2002, 11:58 AM
Hi i have just started learning javascript, but this is really urgent and help would be greatly appreciated:
i am using this javascript, creating a simple dropdown link menue. now i want to change it so that the links open in a new window. sounds simple but i just cant do it. heres the script:
<script language="JavaScript" type="text/javascript">
<!--
// original code by Bill Trefzger 12/12/96
function go1(){
if (document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value != "none") {
location = document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value
}
}
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
document.write('<form name="selecter1"><select name="select1" size=1>');
document.write('<option value=none>Searchmachines');
document.write('<option value=none>--------------------');
document.write('<option value="http://www.yahoo.com">Yahoo');
document.write('<option value="http://www.google.com">Google');
document.write('<option value="http://www.metager.de/">Metager');
document.write('<option value="http://uk.yahoo.com">Yahoo UK');
document.write('<option value="http://www.scoot.co.uk">Scoot');
document.write('</select>');
document.write('<input type="button" value="Go" onclick="go1()">');
document.write('</form>');
// end hiding contents -->
</script>
What do i have to change?
Thanks in advance!!
i am using this javascript, creating a simple dropdown link menue. now i want to change it so that the links open in a new window. sounds simple but i just cant do it. heres the script:
<script language="JavaScript" type="text/javascript">
<!--
// original code by Bill Trefzger 12/12/96
function go1(){
if (document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value != "none") {
location = document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value
}
}
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
document.write('<form name="selecter1"><select name="select1" size=1>');
document.write('<option value=none>Searchmachines');
document.write('<option value=none>--------------------');
document.write('<option value="http://www.yahoo.com">Yahoo');
document.write('<option value="http://www.google.com">Google');
document.write('<option value="http://www.metager.de/">Metager');
document.write('<option value="http://uk.yahoo.com">Yahoo UK');
document.write('<option value="http://www.scoot.co.uk">Scoot');
document.write('</select>');
document.write('<input type="button" value="Go" onclick="go1()">');
document.write('</form>');
// end hiding contents -->
</script>
What do i have to change?
Thanks in advance!!