Detecting if window exists
i need to execute a function when a certain window has been closed.
thanks in advance
You can only detect a window if:
1) you know the name of the window, or
2) you have a pointer to the window because you opened it, or
3) you are in a child window and you want to know about your opener.
Even if you know the name, you still need a pointer. You can get a pointer to a window called "theName" using:
var myWin = window.open("", "theName");
Unfortunately, if the window does not exist, this will open a new empty window.
Once you have a pointer, you can test if the window is closed:
if (myWin.closed) ...
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)