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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close a pop-up window when closing another.

Status
Not open for further replies.

MikeWiz628

Programmer
Dec 24, 2002
22
US
First, I have a button that the user can click on and it opens a small pop-up window with some info inside.

What I want, is when the main window is closed, it closes the pop-up window as well.

What I had tried was putting is <body onunload=window.close('popup.aspx','popwindow')....

Is this possible? Is there a better way to do this?

Thanks in advance!
 
If you open the window, by assigning the reference to a variable, ie:

\\be sure this guy has page scope
var x;

x = window.open(...);

then you can just call:

x.close();

in some body onUnload event
penny1.gif
penny1.gif

The answer to getting answered -- faq855-2992
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top