js打开子页面 关闭后怎么刷新父页面

gul_gui 2010-01-22 10:08:39
javascript:OpenNewWindows 打开一个页面 关闭后怎么刷新父页面
...全文
562 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
cyqlightrain 2010-01-22
  • 打赏
  • 举报
回复
子窗口的window.onclose事件中写,this.parent.location = this.parent.location;
shizhen_zhang 2010-01-22
  • 打赏
  • 举报
回复
<script type="text/javascript">
window.onbeforeunload = function()
{
window.returnValue = true;
}
</script>


用这一个吧。
shizhen_zhang 2010-01-22
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 gul_gui 的回复:]
我不是直接点某个按钮关闭  而是想在点windows窗口的关闭按钮后直接刷新父页面~
[/Quote]
你就在窗口关闭事件下写一句就行了。

如果是用右上角的关闭 触发的事件

<script> 
function window.onbeforeunload(){
window.returnValue = true;

}
}
</script>
flyerwing 2010-01-22
  • 打赏
  • 举报
回复
return一个值然后刷新不知道成吗
gul_gui 2010-01-22
  • 打赏
  • 举报
回复
我不是直接点某个按钮关闭 而是想在点windows窗口的关闭按钮后直接刷新父页面~
shizhen_zhang 2010-01-22
  • 打赏
  • 举报
回复
子窗口关闭
string script = @"<script language=javascript>
window.returnValue = true;
window.close();
</script>";

Page.RegisterStartupScript("Refresh", script);
shizhen_zhang 2010-01-22
  • 打赏
  • 举报
回复
var returnValue = window.showModalDialog("Add.aspx?ID=" + FunNelID + "&Rnd=" + (Math.random() * 100), "", "dialogWidth:400px; dialogHeight:300px; location=no; center:yes;help:no;resizable:yes;status:no;scroll:auto;");
if (returnValue) {
//刷新
}
gul_gui 2010-01-22
  • 打赏
  • 举报
回复
能具体点点吗~~
芽疼 2010-01-22
  • 打赏
  • 举报
回复

Response.Write("<script>window.opener.location.href=window.opener.location.href</script>");
Response.Write("<script>window.opener=null;window.close()</script>");
卧_槽 2010-01-22
  • 打赏
  • 举报
回复
模式窗口
gul_gui 2010-01-22
  • 打赏
  • 举报
回复
来人捡分呀
gul_gui 2010-01-22
  • 打赏
  • 举报
回复
DING

110,502

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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