SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    India
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Controlling popup windows

    Hello,

    I have a requirement in which I need to handle multiple popup windows. There exists a relationship between the parent and the child windows and I store the relationship in javascript variables in the parent window. The relationship is nothing but the reference handle that window.open returns so that I can manipulate the content of the popup windows.

    These variables get lost if the "location.href" of the main parent window changes. To state otherwise, when the user goes to another page in the main window. Now, the popup windows are not yet closed and I still want the relationship to exist. How do I re-establish or get back this relationship?

    Is there a way to get it say by some "window.popup.length" or "window.poppedUpWindows()"?

    Thanks for any input!

    Cheers,
    Celia

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Reference to the child windows is lost once the main window reloads. You could close the child windows once the main window is closed or when the location href changes. Depends on if it makes to keep them open.

    You could also have a dialog asking the user if he really wants to navigate away from the current main page. And inform him that the child windows will be closed.

    It all depends on what you wanna do.


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
  •