Simple Javascript

Sharky Forums


Results 1 to 6 of 6

Thread: Simple Javascript

Threaded View

  1. #1
    Catfish
    Join Date
    Aug 2001
    Location
    UK
    Posts
    191

    Unhappy Simple Javascript

    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!!
    Last edited by Budda; 04-01-2002 at 01:04 PM.
    "Sharing knowledge is a way of achieving immortality"
    "and thanks for all the fish"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •