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 Coder
    Join Date
    Mar 2006
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up avoid open same window twice

    I have a link on a page which opens up a new page, however, every time it is clicked, a new page is opened. 10clicks=10new windows of same page

    is there a way that i can check whether this page is already opened in new window, if yes, just bring this window up, if no, open it?
    Last edited by ssffcc; 06-05-2006 at 05:44 AM.
    Achievement provides the only real pleasure in life.

  • #2
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Use a single, custom target name instead of _blank.

    basic e.g.
    Code:
    <a href="link1.html" target="mynewwindow">link1</a>
    <a href="link2.html" target="mynewwindow">link 2</a>
    - or -

    Use a single, custom target name in all your popup scripts

    basic e.g.
    Code:
    function mypopup() {
    	var newWin = window.open(url,'mynewwindow');
    }
    
    
    
    <a href="link1.html" onclick="mypopup(this.href); return false;">link1</a>
    <a href="link2.html" onclick="mypopup(this.href); return false;">link 2</a>

  • #3
    New Coder
    Join Date
    Mar 2006
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thx Bill, problem solved
    Achievement provides the only real pleasure in life.


  •  

    Posting Permissions

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