Results 1 to 2 of 2

Thread: Close window, refresh page, why is this so hard

  1. #1
    Join Date
    Apr 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Close window, refresh page, why is this so hard

    I have a php script with a list of links. When the user clicks on a link, a window pops up with a different php script where the user can some fields. When that form is submitted, the window closes.

    I need the original page to reload when the popup window closes. I think there would be two ways of doing this:

    - Have the popup window's php script call the original window's php script
    - Have the original script listen for an onunload() event of the popup window

    For some reason, I'm finding it incredibly difficult to even find an example of how to handle a window's events. I can't believe how poor JavaScript documentation is online. If someone could, at the very least, point me to a serious reference site, not a site with a grab bag of novelty scripts, I would appreciate it.

    Thanks,
    Jason

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    - Have the popup window's php script call the original window's php script
    That would require client-side interaction by PHP, which is of course impossible.
    - Have the original script listen for an onunload() event of the popup window
    Like so:
    Code:
    <body onunload="window.opener.location.href = window.opener.location.href;">
    For some reason, I'm finding it incredibly difficult to even find an example of how to handle a window's events.
    Well, there are plenty out there.
    I can't believe how poor JavaScript documentation is online.
    The definitive reference is, of course, ECMA RFC 262.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •