<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> 测试刷新页面 </TITLE>
</HEAD>
<BODY>
<input TYPE="button" ONCLICK=" test()" value="打开页"></input>
<script>
window.name = "origin";
var windowObjectReference;
var strWindowFeatures = "width=1000,height=500,menubar=yes,location=yes,resizable=yes,scrollbars=true,status=true";
function test() {
windowObjectReference = window.open("https://www.json.cn/", "name", strWindowFeatures);
}
var loop = setInterval(function () {
if (windowObjectReference.closed) {
clearInterval(loop);
location.reload();
alert("刷新成功");
}
}, 1000);
</script>
</BODY>
</HTML>
js监听打开窗口关闭事件 刷新页面
于 2022-03-31 11:47:18 首次发布