Is it possible for parent window to notice if child window has been closed ???
- by masato-san
I have parent window (opener) and child (popup)
---------- --------------
| | | |
| parent | -----> opens popup | child |
| | | |
----------- --------------
Let's say, in parent page, I have js function hello()
In order for child to call parent's hello() when the child window is closed and also pass an argument, I can do,
window.close();
window.opener.hello(someArgument);
This will close the window and also call parent's hello();
But what if I don't want to have the code window.opener.hello() in child page? I mean I want the code to be in parent page only
One thing I can think of is:
Somewhat parent knows when the child is closed (event listenr??? not sure in js)
But in such case how to receive the argument? (i.e. some data back from the child)