Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Trouble with Double Combo script

    The script is located at this page
    http://javascriptkit.com/script/cut183.shtml

    I cant seem to have my links open in a new window I tried target="_new" but it doesnt work. Heres what the link part for the code looks like:


    group[0][0]=new Option("JavaScript Kit","http://javascriptkit.com")
    group[0][1]=new Option("News.com","http://www.news.com")
    group[0][2]=new Option("Wired News","http://www.wired.com")

    group[1][0]=new Option("CNN","http://www.cnn.com")
    group[1][1]=new Option("ABC News","http://www.abcnews.com")

    group[2][0]=new Option("Hotbot","http://www.hotbot.com")
    group[2][1]=new Option("Infoseek","http://www.infoseek.com")
    group[2][2]=new Option("Excite","http://www.excite.com")
    group[2][3]=new Option("Lycos","http://www.lycos.com")

    I'm new here and hope I posted this in the right section of the forum.

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try replacing this line:

    location=temp.options[temp.selectedIndex].value;


    with this

    window.open(temp.options[temp.selectedIndex].value);

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You need to change the go function using window.open.
    function go(){
    loc=temp.options[temp.selectedIndex].value
    NewWin=window.open(loc,"win1")
    }

    You can also add properties to the window.open to determine the size of the window and other things.

    Check out this tutorial on windows:
    http://www.javascriptkit.com/javatutors/window1.shtml

  • #4
    New to the CF scene
    Join Date
    Jun 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Garadon
    try replacing this line:

    location=temp.options[temp.selectedIndex].value;


    with this

    window.open(temp.options[temp.selectedIndex].value);
    Worked like a charm, thanks for your time U2 I really appreciate it


  •  

    Posting Permissions

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