分都不给,悲剧哦
不太清楚你的意思,这里有段我写的子窗口关闭时回调父窗口函数的方法,希望对你有帮助
page1.html
<html>
<head>
<title>主页面</title>
<script type="text/javascript">
var idx = 0
function openSubWin()
{
window.open('page2.html', 'newwindow',
'height=100, width=100, top=0, left=0, toolbar=no, menubar=yes, scrollbars=yes,resizable=yes,location=no, status=no');
}
//关闭子窗口回调函数
function fun1(){
//alert("你关闭了子窗口");
document.getElementById('btn1').value = "弹出子页面 " + (++idx) + "次";
}
</script>
</head>
<body>
<input type="button" id = "btn1" value="弹出子页面" onclick = "openSubWin()" />
</body>
</html>
page2.html:
<html>
<head>
<title>子页面</title>
<script type="text/javascript">
function closeWin()
{
window.opener.fun1();
window.close();
}
</script>
</head>
<body>
子页面<br/>
<input type = "button" value = "关闭窗口" onclick = "closeWin();"/>
</body>
</html>
温馨提示:内容为网友见解,仅供参考