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 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Control a child window through parent.

    I would like to have an onClick function that will oren another window the first time it is clicked and if it is already open in the background, the onClick would simply focus the window.

    Thanks!

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <html>
    
    <head>
    
    <script>
    
    function openit() {
    if (window.pop) {
    pop.focus();
    }else{
    pop=window.open("","","");
    }
    }
    </script>
    
    </head>
    
    <body>
    
    <a href="javascript: openit();">Open</a>
    
    </body>
    
    </html>


  •  

    Posting Permissions

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