Javascript examples for Browser Object Model:Window Load
From a parent window check if its child window is closed
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {//from w w w. jav a 2 s.com var intervalID, childWindow; childWindow = window.open("http://www.google.com"); function checkWindow() { if (childWindow && childWindow.closed) { window.clearInterval(intervalID); console.log('closed'); } } var intervalID = window.setInterval(checkWindow, 500); }); </script> </head> <body> </body> </html>