Javascript timer in parent window is cancelled on child window close
- by Tom Carter
I have a user UserControl on a web page. There is a javascript timer started by the control on the client that causes a web service to be called every few seconds. If the user clicks on the control a new browser window is opened (with window.open() ) to show a different page. Note the onclick returns false so there is no postback to the page.
The page displayed in the second window also has a timer that operates in the same way as the first (calls a WebService at intervals). Upto this point everything is fine - each of the timers continue to run in their respective window.
However, when I close the second window (either by clicking on the cross of the window or by calling self.close() ) the timer in the first stops. I've no idea why.
Is there some relationship between the opener and opened window that I'm missing ?