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
Edit
I checked this thread: Find window previously opened by window.open And did as the answer suggested, with no luck. But perhaps I am misunderstanding the idea.
What I did was:
I created
function tjek_ClosePlayer()
{
var playerUrl = 'custom_inserts/custom_player.php';
var mainPlayer= window.open('', 'mainPLayer', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=605, height=100') ;
if(mainPLayer.location == 'about:blank' ){ mainPlayer.location = playerUrl ; }
mainPLayer.close();
}
And then called the function, onclick, from the refreshed page. No luck.
Anyone?