Click to See Complete Forum and Search --> : probs with childwindow ---- emergency pls


sivasankari
08-29-2003, 01:56 AM
Hai,
The application goes like this, after i login into the site i open a child window called find student. Now i minimise that window and navigate thru some other pages in the main window. suppose in the next window i may open another child window for say, new student and minimise that window also . Now again i navigate to another page and click logout here, when i click the button i am supposed to comeout of the system which works properly, at the same time all child windows i opened should get closed. As of now, even after i logout the system child windows opened remains minimised itself. The problem is, on logging out all the child windows should get closed.Is there anyway to overcome this, kindly help me out.

Note: In all pages i have logout button

Thanks

Gollum
08-29-2003, 02:43 AM
In your popup windows, you could put the following...

<script>
function checkOpener()
{
if ( window.opener.closed ) window.close();
window.setTimeout("checkOpener();", 1000);
}
window.setTimeout("checkOpener();",50);
</script>

sivasankari
08-29-2003, 02:50 AM
will i call the function checkOpener(), whether in child window's onload? if so also till the time setout, windows will be open isn't it?

Gollum
08-29-2003, 03:01 AM
You don't need to do anything more, just add that script code in all of your popup windows. It will schedule its own first call 50ms after loading and at 1 second intervals after that (feel free to change that).

It's not an ideal solution but it works fairly well (unless your popup window gets an exception in which case it won't be able to close itself).

sivasankari
08-29-2003, 03:48 AM
thanks a lot Mr.Gollum, its working finely