Example007关闭窗口时关闭父窗口

时间:2023-12-10 18:42:56
<!--实例007关闭窗口时刷新父窗口-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>实例007关闭窗口时刷新父窗口</title>
</head>
<body>
<a href="#" onClick="Javascript:window.open('index.html','','width=300,height=100')">点击按钮</a>
<br>
<input type="submit" name="Sublime" value="关闭" onClick="Mycheck();">
<script>
function Mycheck() {
alert("关闭子窗口!");
// 刷新父窗口中的网页
window.opener.location.reload();
// 关闭当前窗口
window.close();
}
</script>
</body>
</html>