Click to See Complete Forum and Search --> : Call function in parent window when child has not finish loading??


shula37
01-23-2003, 08:53 AM
Hi there,

I have a parent window (A) which calls a child window (B) containing two frames. I have a timer in A and starts when the A loads. At the same time, A opens B. B is supposed to call the stop timer function in A.

If I wait for B to finish loading and then close B, the timer in A is stopped. But the timer DOES NOT stop when B is closed before it finishes loading. Does anyone know why??

jdavia
01-23-2003, 11:41 AM
A opens B. B is supposed to call the stop timer function in A.
But the timer DOES NOT stop when B is closed before it finishes loading. Does anyone know why??

When you closed "B" before it finished loading itself, you also stopped "B" before it completed its task. Window "A" never got the message to stop the timing.

Webskater
01-23-2003, 12:57 PM
You could use the onbeforeunload event in window B to call whatever method you are using to control the timer in window A so that, if B is closed before it finishes loading, it will still do the job.

shula37
01-23-2003, 07:19 PM
It works! Thanks all! You have been really helpful. I couldn't find this event handler in any of the javascript references.

cheers,
kendra