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 to the CF scene
    Join Date
    Aug 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Count the popup windows from main window

    Is there any way we can count the number of popup windows opened from a main(opener) page?
    The popup windows will be opened from the main page using window.open. I want to make sure that only one pop up is open from this main page.
    Thanks.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,950
    Thanks
    0
    Thanked 236 Times in 233 Posts
    why not just open the popups in the same target name

    function doOpen(url){
    var w = window.open(url,'myOnlyPopup','width=800,height=600');
    w.focus();
    return false;
    }
    ...
    <a href="popup1.htm" target="myOnlyPopup" onclick="return doOpen(this.href)">Popup#1</a>

    <a href="popup2.htm" target="myOnlyPopup" onclick="return doOpen(this.href)">Popup#2</a>

    <a href="popup3.htm" target="myOnlyPopup" onclick="return doOpen(this.href)">Popup#3</a>

    That will open popups in the window named 'myOnlyPopup'


  •  

    Posting Permissions

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