当试图在弹出窗口中加载相同页面时,弹出窗口关闭

Popup window closing when trying to load same page in the popup

本文关键字:窗口 加载      更新时间:2024-01-30

我使用window.open(url,name,properties)作为popup.html创建了弹出窗口我想在同一个弹出窗口中加载相同的页面(popup.html)。但它不允许我关闭弹出窗口。为什么会这样。?

非常感谢您的任何回复
编辑:

<script type="text/javascript">
var url = "login.htm?login=true";
var strWindowName ="newWindow";
var strWindowFeatures = "left=0,top=0,width=1200,height=600,location=no,resizable=yes,scrollbars=yes,status=yes";
var windowObjectReference = window.open(url,strWindowName,strWindowFeatures);
this.window.close();
</script>

我意识到,由于线路this.window.close();
,它正在关闭如果我评论这一行,那么它将导致窗口调用的无限循环。