SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Controlling windows count

    Is there a way in Javascript to control how many windows you have open at once? For example I have a javascript for a pop up window. You click the link, window pops up, now I dont want them to be able to click the same link to open another window while the first popup is still open. Can this be done?

    Thanks
    Silly

  2. #2
    SitePoint Enthusiast kellogs's Avatar
    Join Date
    Apr 2004
    Location
    kellogs
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    name each window and I think you can check if they are open with: if (window.windowname)

  3. #3
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something like this?

    Code:
    function openOnce(url) {
        if(!window.popup || window.popup.closed)
              window.popup = window.open(url, "POPUP");
    }

  4. #4
    SitePoint Guru
    Join Date
    Jun 2004
    Location
    Finland
    Posts
    703
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Open the new popup with the same name as the first one. This way it'll use the same window as the first popup.


Bookmarks

Posting Permissions

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