javascript window.close, once again

Posted by John Kjøller on Stack Overflow See other posts from Stack Overflow or by John Kjøller
Published on 2012-09-06T15:36:00Z Indexed on 2012/09/06 15:38 UTC
Read the original article Hit count: 188

Filed under:
|

Im sorry if I havent done my research properly, - but couldnt find the answer I needed, so here goes:

From my main page I open a new window using mainPlayer = window.open();

This window stays open until user clicks on a mainPlayer.close(); event. (or simply x closes the window)

However, the idea is to make it possible to let the player keep playing, while browsing around the rest of the pages.

But as soon as the user leaves the page that opened the mainPlayer window, the reference to the mainPlayer window seem to be lost.

How do I, from the site's other pages, check if the mainPlayer window is open and close it on a click event?

Thx John

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about window