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
Release: 2016-05-16 15:45:41
Original
1122 people have browsed it

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);
 }
}

Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template