Closed Thread Icon

Topic awaiting preservation: Check to see if child window is still open (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8573" title="Pages that link to Topic awaiting preservation: Check to see if child window is still open (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Check to see if child window is still open <span class="small">(Page 1 of 1)</span>\

 
kw7669
Nervous Wreck (II) Inmate

From: Columbus, Ohio, USA
Insane since: Nov 2002

posted posted 03-14-2003 16:31

Hello. I need to know to how check if a child window is still open from a parent window that opened it. I am not having much luck finding anything online and was hopeing someone could help.


//this function open the window
var ReturnWindow = null;

function AddReturn()
{
if (ReturnWindow == null)
{
//This will open the extra item pop up
ReturnWindow = window.open'AddReturn.asp?','ReturnItems','width=670,height=500');
ReturnWindow.focus;
}
}


//This is supposed to check if the window is still open
function WindowClose()
{
if (ReturnWindow != null)
{
alert("Please close or submit all the extra forms.");
ReturnWindow.focus;
}
}

I get the alert box if the window is open but I also get the alert box if the window was opened and closed. Thanks for any help.

Ken

Thank you and have a great day.

Ken

Archonian
Nervous Wreck (II) Inmate

From: Sweden, Malmoe
Insane since: Jan 2003

posted posted 03-15-2003 20:30

Try setting the variable ReturnWindow to null when the opened window closes.
I'm not sure about this, but I think you could do something like:
onUnLoad="opener.ReturnWindow = null;"
I could be sooo wrong.

Or you could just check this page: http://www.xs4all.nl/~ppk/js/croswin.html

[This message has been edited by Archonian (edited 03-15-2003).]

Nevel
Bipolar (III) Inmate

From: Amsterdam
Insane since: Jun 2002

posted posted 03-16-2003 17:57

if(newWin && !newWin.closed)
alert('newWin is not null, so the child window was opened once, and newWin.closed is false, so it is still open');

« BackwardsOnwards »

Show Forum Drop Down Menu