
closing a popup when the parent closes.
When you open the window using window.open, it returns a "handle"
var xxx = window.open()
onBeforeUnload of your main window call
if (xxx.open)
xxx.close()
this will close the popup.
Just make sure that you retain the xxx value and don't loose it when
reloading frames.
You could put it in the main frames code (Parent)
Cheers,
Crispin
Quote:
> I have a page that opens a popup window, the popup is a
> frameset whos frames are dynamicly populated based on
> various user interactions. One of the first things that
> alwase happens is the frameset is replaced with another
> framset that compleatly fills the popup window
> (location.top).
> I need to enforce a buisness rule that if a user closes
> the original window (the parent) the popup closes as well.
> Normaly I would just have a script in the popup poll for
> the existance of the parent, but since there is no one
> page that is alwase going to be availible, I am unsure as
> to where to place the script. I really don't want to
> change any of the frames that are built in the popup, but
> that is all I can think of.
> So If there is a way to do this from the parent I am all
> ears.
> Thanks in advance.
> Ty