Child WIndow가 닫혔는지 조사하기

in it •  7 years ago 

먼저 child window가 열려있다가 가정합니다.

win = window.open(...);

다음은 setInterval로 0.1초마다 Child WIndow가 살아있는지 체크하니다.

var timer, win;
function polling(){
if (win && win.closed) {
clearInterval(timer);
alert('popup window is closed.');

}
timer = setInterval('polling()',100);

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

i don't understand anything of this but i like it. lol