|
|
Q272 When a page is reloaded how can it check that any window it previously opened is not still open before attempting to open it again?
irt.org | Knowledge Base | JavaScript | Window | Q272 [ previous next ] Q272 When a page is reloaded how can it check that any window it previously opened is not still open before attempting to open it again?Once the location of a page has changed, or the page has reloaded, it loses all knowledge about any windows it may have opened. Therefoe code to detect whether the popup window is still open will not work. The only workaround is to use a frameset with a hidden frame and to open the popup window from the parent frameset. This way the reference to the popup window is preserved even if one of the frames is reloaded.
If need be you can then invoke the parents openWindow() function from one of the frames to reopen the window if you think it may have been closed, with: parent.openWindow(). the following was submitted anonymously: I don't use frames, below is the code I use. The parent window can check to see if the daughter window is already open or don't allow the daughter window to lose focus "focus"... In the parent window open the daughter window with the following code:
Feedback on 'Q272 When a page is reloaded how can it check that any window it previously opened is not still open before attempting to open it again?' |
-- div -->
|