最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
一种在父窗口中得知 window.open()出的子窗口关闭事件的方法(定时器实现)
时间:2022-06-30 09:47:39 编辑:袖梨 来源:一聚教程网
parent.htm :
<HTML><BODY>
<P> </P>
<form name=fm_Info>
<input type=text name=txtValue>
</form>
<script language=javascript>
var timer
var winOpen
function IfWindowClosed() {
if (winOpen.closed == true) { document.fm_Info.txtValue.value="child closed"
window.clearInterval(timer)
}
}
</script>
<input type=button name=btnOpen value=open>
<script language=javascript for=btnOpen event=onclick>
document.fm_Info.txtValue.value=""
winOpen=window.open("child.htm","","toolbar=no, location=no, directories=no, status=no, menubar=no" )
timer=window.setInterval("IfWindowClosed()",500);
</script>
</BODY></HTML>
------------------
There can be anything in child.htm
<HTML><BODY>
<P> </P>
<form name=fm_Info>
<input type=text name=txtValue>
</form>
<script language=javascript>
var timer
var winOpen
function IfWindowClosed() {
if (winOpen.closed == true) { document.fm_Info.txtValue.value="child closed"
window.clearInterval(timer)
}
}
</script>
<input type=button name=btnOpen value=open>
<script language=javascript for=btnOpen event=onclick>
document.fm_Info.txtValue.value=""
winOpen=window.open("child.htm","","toolbar=no, location=no, directories=no, status=no, menubar=no" )
timer=window.setInterval("IfWindowClosed()",500);
</script>
</BODY></HTML>
------------------
There can be anything in child.htm
相关文章
- 光遇12.23每日任务怎么做 光遇12月23日每日任务做法攻略 12-23
- 光遇12.23大蜡烛在哪里 光遇12月23日大蜡烛位置攻略 12-23
- 光遇12.23免费魔法有什么 光遇12月23日免费魔法收集攻略 12-23
- 《流放之路2》寻找熔炉任务攻略分享 12-23
- 《流放之路2》德雷文打法技巧分享 12-23
- 《流放之路2》永恒裁判者德雷文具体位置介绍 12-23