tags:

views:

27

answers:

1

Hi Everyone,

I have this little function to open/close a popup player:

function popuponclick(popup)
{
  my_window = window.open("folder/player-itself.htm", popup, "width=350,height=150");  
}

function closepopup()
{
  my_window.close();
}

I call the functions from HTML anchors that are on each page of the site (idea is to have the player stopped/started whenever you want)...now...

it works well until i change the page, or refresh the existing one - and from then the window can't be closed anymore. Any idea where i'm wrong? Tested in FF and IE8, same behavior.

Thanks for your help.

+1  A: 
Pointy
Beat me to it, and did it more poetically :)
annakata
Wow! Thanks Pointy for this super cool answer. I get it.Will not insist but code snippet to take care of this would be greatly appreciated.
Ramon
Beat me to it too.. Also,another way to remember the window handle even on page refreshes, check these links http://www.irt.org/script/782.htm and http://www.irt.org/script/874.htm.
Ravindra Sane