티스토리 뷰
728x90
반응형
let closeWindowCheck = windowObj => {
// 0.5초 마다 감지
g_oInterval = window.setInterval(function() {
try {
// 창이 꺼졌는지 판단
if( windowObj == null || windowObj.closed ) {
window.clearInterval(g_oInterval);
windowObj = null;
// Todo....
//.....
console.log("창꺼짐");
search(compName, workStatus, kwd, 'true');
}
} catch (e) { }
}, 500);
};
windowObj는 windowObj = window.open('', '', ''); 이다
자식창이 종료되었는지 확인하면서 창이 종료되면 특정 작업을 수행할때 사용
728x90
반응형
'JavaScript' 카테고리의 다른 글
[주소검색API] 주소검색 API 사용 (0) | 2019.06.13 |
---|---|
[JavaScript & window] 팝업창 브라우저 중앙에 위치 (0) | 2019.06.13 |
[JavaScript & window] 페이지가 새로고침될때 작업하는방법 (1) | 2019.06.13 |
[JavaScript & window] 부모팝업창이 새로고침 or 종료되면 자식창을 다 제거하는방법 (0) | 2019.06.13 |
[JavaScript & window] 팝업창 띄우는 방법 (0) | 2019.06.13 |
댓글