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

Opening and closing the child windows, if the parent window is closed

Status
Not open for further replies.

elvisdinesh

Technical User
Sep 11, 2002
1
0
0
US
Hi :),

Thanks in Advance, to anyone who can help me in my problem.

My Problem is,

I have a function which opens up child windows

function openNewWin(strWinName) // function to open a new window...
{
noOfWin ++;
winArray[noOfWin] = window.open(strWinName, '', strWinProp);
}

and a corresponding function to close all these opened windows.

function closeAll() // function to close all the window opened using the current window...
{
for(i = 0; i <= noOfWin; i++)
{
if(window.winArray != null && !winArray.window.closed)
{
alert(winArray.name);
winArray.window.close();
}
}
noOfWin = -1;
}

I call the close function in the onUnLoad of the BODY tag of the main window.

This works fine, if I open a few windows and before closing any of the child windows. If I close any one of the child windows. The script for closing the window stops and gives a message &quot;The callee (server [not server application]) is not available and disappeared; all connections are invalid. The call did not execute.&quot;

Thanks for your time.

Thank you,
Elvis Dinesh
:)
 
The check should be:
if(window.winArray != null && !window.winArray.closed)
not as typed:
if(window.winArray != null && !winArray.window.closed)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top