Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

handling window.closed

Status
Not open for further replies.

brucegonewild

Programmer
Jan 25, 2008
22
CA
This must be super easy for you javascript wizards! here's my code:

Code:
var myHandle = window.open(url);
if (myHandle.closed)
{
   alert("aloha");
}


Just a note, myHandle is a local function variable.
Is there an onClosed event that I can handle? Any help is much apreciated!!
 
What is this part supposed to do?
Code:
var myHandle = window.open(url);
if ([!]myHandle.closed[/!])
{
   alert("aloha");
}

Are you basically trying to say "alert aloha when the popup window is closed"?

If so, you have to assign an onunload handler to the url you pop up. I'm pretty sure that if it's on a domain other than the parent page that you will not be able to modify the contents of the popup window.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson

[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top