日期:2014-05-17 浏览次数:21019 次
<html>
<head>
<script type="text/javascript">
function open_win()
{
window.open("open.html")
}
function test(){
alert("parent");
}
</script>
</head>
<body>
<form>
<input type=button value="打开窗口" onclick="open_win()">
</form>
</body>
</html>
<html>
<head>
<script type="text/javascript">
function test(){
alert("close");
}
</script>
</head>
<body onunload="window.opener.test()" onbeforeunload ="test()">
<form>
</form>
</body>
</html>