最新下载
热门教程
- 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
相关文章
- 《无限暖暖》蓝色跃动设计图位置怎么找 06-16
- 《出发吧麦芬》金色歌剧院副本怎么通关最快 06-16
- 《无限暖暖》花心追爱记获得方法大全 06-16
- 《封神幻想世界》八星妖王进阶打法思路推荐 06-16
- 《众神派对》五星角色女娲风女希详细介绍 06-16
- 《弹壳特攻队》零氪/微氪怎么出装最有效 06-16