Auto Closing child window

Discussion in 'JavaScript' started by love_bug, Aug 25, 2006.

  1. #1
    Hi,
    I've seen sites that auto close it's child windows, when the parent page is closed or changed main url~
    Is there a way to do it using javascript or possibly adding php codes? I heard that i can be achieved with javascript cookie?

    It would so helpful.. if you could show me how!1 thanks
     
    love_bug, Aug 25, 2006 IP
  2. QiSoftware

    QiSoftware Well-Known Member

    Messages:
    805
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    158
    #2
    PHP cannot close a local window. With JavaScript associate the child window with the parent when opening.

    Q...
     
    QiSoftware, Aug 25, 2006 IP
  3. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #3
    When opening a child window (with window.open()), you can assign a name to the child window. With this name, you can refer to the child window from the parent window, and close it on a certain event.

    To detect the URL has changed, there's an "onunload" event.
     
    phper, Aug 27, 2006 IP
  4. love_bug

    love_bug Member

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    Thanks guys
     
    love_bug, Sep 9, 2006 IP