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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Open link in new popup, not existing popup

    Hi, Can anyone help me,

    When I click a link on my site a popup opens but when I click another link it opens in the same popup window.

    how do I get it to open a new popup window for every link?

    Here's the code I'm using:

    menu.subMenus[2].addItem("Mp3z","window.open('music/mp3z.html','popup','width=300,height=300')");

    it is part of a large js menu.

    Thanks

  • #2
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Code:
    menu.subMenus[2].addItem("Mp3z","window.open('music/mp3z.html','_blank','width=300,height=300')");
    Right, glenngv?

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,030
    Thanks
    0
    Thanked 247 Times in 244 Posts
    Using "_blank" will always open the link in new window even if that link is already open. If you want to open each link in its own popup window, use different window target for each link.
    Code:
    menu.subMenus[2].addItem("Mp3z","window.open('music/mp3z.html','menu1','width=300,height=300').focus();");
    menu.subMenus[3].addItem("Mp3z2","window.open('music/mp3z2.html','menu2','width=300,height=300').focus();");
    ...


  •  

    Posting Permissions

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