Home >Web Front-end >JS Tutorial >js method to determine whether a subform is closed_javascript skills

js method to determine whether a subform is closed_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:45:411130browse

The example in this article describes the js method to determine whether the subform is closed. Share it with everyone for your reference. The details are as follows:

function InsideMessageAdd() {
 //window.open()得到子窗体
 tip = OpenDialog('UploadFile.html?tp=nbtz', 'msg', 650, 180);
 //启动timer,判断子窗体是否关闭
 timer = window.setInterval("IfWindowClosed()", 500);
}
var timer;
var tip;
function IfWindowClosed() {
 //判断子窗体是否关闭
 if (tip.closed == true) {
  alert("close");
  window.clearInterval(timer);
 }
}

I hope this article will be helpful to everyone’s JavaScript programming design.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn