有模式弹出子窗体,关闭时刷新父窗体

来源:互联网 发布:js获取字符串长度函数 编辑:程序博客网 时间:2024/04/28 08:44

主窗体
<html>
<head></head>
<script>
alert('aaa');
function show()
{
   window.showModalDialog('test.html',window,'dialogHeight:400px;dialogWidth:54f0px;center:yes;help:no;resizable:no;status:no;scroll:no;');
   window.location.reload();
}
</script>
<body>
<button onclick="show();">Test.html</button><br/>
</body>
</html>

子窗体
<html>
<head>
<base target="_self" />
</head>
<body>
<h1>Welcome Test.html</h1>
<button onclick="window.close();">aaa</button>
</body>
</html>

原创粉丝点击