共有16159人关注过本帖树形打印

主题:JS刷新父页面

帅哥哟,离线,有人找我吗?
zhirui
  1楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:520 积分:8740 威望:0 精华:5 注册:2009-07-07
JS刷新父页面  发帖心情 Post By:2013-05-14 10:43:50

 

用iframe、弹出子页面刷新父页面

iframe
   parent.location.reload();

弹出子页面
   window.opener.location.reload();

子窗口刷新父窗口

    self.window.opener.locaction.reload();

刷新一open()方法打开的窗口

    window.opener.location.href = window.opener.location.href

刷新以winodw.showModelDialog()方法打开的窗口

    window.parent.dialogArguments.document.execCommand('Refresh');  

Response.Write("<script>window.location.href = window.location.href</script>");

刷新本页Response.Write("<script>window.location.href=window.location.href; </script>");

刷新父页和本页面:

Response.Write("<script>alert(' 提交成功!');window.location.href=window.location.href; window.opener.location=window.opener.location;</script>");


政府公安政府系统,专注于政府媒体,公安公众信息系统 支持(0中立(0反对(0回到顶部
帅哥哟,离线,有人找我吗?
zhirui
  2楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:520 积分:8740 威望:0 精华:5 注册:2009-07-07
  发帖心情 Post By:2013-05-14 10:52:40

 

1.刷新父页面并关闭子页面

this.Response.Write("<script>window.opener.opener null;window.opener.location.replace(window.opener.location.href);window.close();</script>");
//
this.Response.Write("<script>window.opener.opener=null;window.opener.location.reload();</script>");
//
this.Response.Write("<script>window.opener.location.replace(window.opener.document.referrer);window.close();</script>");
//this.Response.Write("<script>window.opener.opener=null;window.opener.navigate('index.aspx');window.close();</script>");

2.刷新指定的父页面

this.Response.Write("<script>window.opener.opener=null;window.opener.navigate('index.aspx');</script>"); 

3.刷新父页面

this.Response.Write("<script>window.opener.opener=null;window.opener.location.replace(window.opener.location.href);</script>");

企业开源网站管理系统,中小型企业的成长伙伴 支持(0中立(0反对(0回到顶部