views:

39

answers:

1

Page x creates a pop-up window (page y). When page y is closed, I need an event to trigger on page x.

Any help is appreciated. Thanks.

A: 

You can use the JavaScript window.opener to access the parent window (x) from the child window (y), so you can, or should be able to, use the onunload or onbeforeunload events in the child window (y) to trigger a function in the parent window (x).

David Thomas
But not in Opera, as Tim explains in the dupe.
Marcel Korpel
@Marcel: ah, I hadn't seen the dupe. Up-voted Tim now that I've seen it.
David Thomas