获取window.open()页面的关闭事件;父亲页面获取关闭事件后,根据子页面的返回值,拼凑规定编号;
<html>
<head>
<script>
function openWin(){
var win = window.open("",800,600);
if(win!=null){
if(window.attachEvent) win.attachEvent("onbeforeunload", quickOut);
if(window.attachEvent) win.attachEvent("onunload", quickOut);
}
}
function quickOut(){
alert("关闭窗口");
}
</script>
</head>
<body>
<input type="button" value="点击" οnclick="openWin()"/>
</body>
</html>