62,074
社区成员
发帖
与我相关
我的任务
分享
var ret=window.showModalDialog('url','arguments');
if(ret==true)
{
window.location.href=window.location.href;
window.close();
}
<html>
<body>
<input type='button' value='打开b页面' onclick="window.open('b.html');" />
</body>
</html>
<html>
<body>
<script>
function OpenNew()
{
window.opener.open('c.html');
window.close();
}
</script>
<input type='button' value='弹出c页面关闭当前窗口' onclick='OpenNew()' />
</body>
</html>
<html>
<body>
<input type='button' value='关闭并刷新a'
onclick='window.opener.location=window.opener.location;window.close();' />
</body>
</html>