父窗口中得知window.open()出的子窗口关闭事件
一种在父窗口中得知window.open()出的子窗口关闭事件的方法
parent.htm :
<HTML><BODY>
<script language=javascript>
var timer
var winOpen
function IfWindowClosed()
{
if (winOpen.closed == true)
{
document.fm_Info.txtvalue.value="child closed"
window.clearInterval(timer)
}
}
</script>
<script language=javascript for=btnOpen event=onclick>
winOpen = window.open("child.htm","","menubar=no" )
timer = window.setInterval("IfWindowClosed()",500);
</script>
一种在父窗口中得知window.open()出的子窗口关闭事件的方法
parent.htm :
<HTML><BODY>
<script language=javascript>
var timer
var winOpen
function IfWindowClosed()
{
if (winOpen.closed == true)
{
document.fm_Info.txtvalue.value="child closed"
window.clearInterval(timer)
}
}
</script>
<script language=javascript for=btnOpen event=onclick>
winOpen = window.open("child.htm","","menubar=no" )
timer = window.setInterval("IfWindowClosed()",500);
</script>