有没有办法将 REFRESH 之前弹出的窗口关闭?

cknuke 2002-07-28 01:46:19
<html>
<head>
<title>URL</title>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<META HTTP-EQUIV="REFRESH" CONTENT="2; URL=http://51st.51.net/nuke/index.htm">
</head>
<body OnLoad="DesignerWizWin=window.open('http://mydns.chinadns.com/popup.htm', 'popup', 'toolbar=0, location=0, directories=0, menuBar=0, scrollbars=0, resizable=0, width=433, height=195, left=200, top=200');">
</body>
</html>
以上是源代码 我想在http://51st.51.net/nuke/index.htm这一页里将弹出窗口DesignerWizWin去掉 有办法吗?
请赐教(给分无上限)
...全文
137 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
cknuke 2002-07-29
  • 打赏
  • 举报
回复
看来没办法了啦

因为我根本就没有操作第一页的权利

我只能操作http://51st.51.net/nuke/index.htm
alexxing 2002-07-28
  • 打赏
  • 举报
回复
反了,应该先关闭再刷新

setTimeout(2000,"refresh_and_close();");
function refresh_and_close()
{
if(this.DesignerWizWin //确保DesignerWizWin对象存在
&& !DesignerWizWin.closed) //未关闭
DesignerWizWin.close(); //则关闭

this.location.reload(); //刷新当前窗口
this.locatoin.url = "http://51st.51.net/nuke/index.htm"; //刷新当前窗口的另一种办法
}
alexxing 2002-07-28
  • 打赏
  • 举报
回复
上面忘了刷新窗口了

setTimeout(2000,"refresh_and_close();");
function refresh_and_close()
{
this.location.reload(); //刷新当前窗口
this.locatoin.url = "http://51st.51.net/nuke/index.htm"; //刷新当前窗口的另一种办法

if(this.DesignerWizWin //确保DesignerWizWin对象存在
&& !DesignerWizWin.closed) //未关闭
DesignerWizWin.close(); //则关闭
}
alexxing 2002-07-28
  • 打赏
  • 举报
回复
一点REFRESH,窗口实际上是个新窗口了,原窗口中的一切对象,包括DesignerWizWin,都无法引用了

可以用setTimeout()代替META实现REFRESH,在刷新之前先关闭DesignerWizWin

setTimeout(2000,"closeDesignerWizWin();");

function DesignerWizWin()
{
if(this.DesignerWizWin //确保DesignerWizWin对象存在
&& !DesignerWizWin.closed)
DesignerWizWin.close();
}
saucer 2002-07-28
  • 打赏
  • 举报
回复
try

<html>
<head>
<title>URL</title>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<META HTTP-EQUIV="REFRESH" CONTENT="2; URL=http://51st.51.net/nuke/index.htm">
<script language="javascript">
var DesignerWizWin;
</script>
</head>
<body Onload="DesignerWizWin=window.open('http://mydns.chinadns.com/popup.htm', 'popup', 'toolbar=0, location=0, directories=0, menuBar=0, scrollbars=0, resizable=0, width=433, height=195, left=200, top=200');" Onbeforeunload="if (!DesignerWizWin.closed) DesignerWizWin.close()">
</body>
</html>
cknuke 2002-07-28
  • 打赏
  • 举报
回复
不行……

我再说一下 我是在 2 秒后指向的http://51st.51.net/nuke/index.htm网页内想将前面弹出的窗口 DesignerWizWin 去掉

楼上的方法试过了 出错说DesignerWizWin没定义
我在本机上试时 没出错 但也没用
孟子E章 2002-07-28
  • 打赏
  • 举报
回复
<body OnbeforeunLoad="DesignerWizWin.close()">

87,994

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧