1

我正在使用以下方法从页面A打开一个弹出窗口B

this.Page.ClientScript.RegisterStartupScript(  
      this.GetType(), 
      "JavaScript", 
     "myWindow=window.open('B.aspx',
     'WindowName',
     'copyhistory=no, 
     width=800, 
     height=300, 
     top=150, 
     left=50, 
     resizable=1, 
     scrollbars=1');
     myWindow.focus();", 
     true
);

每当弹出窗口B发生变化时,我都想刷新页面A

4

2 回答 2

1

有很多方法可以做到:

<script>
    window.onunload = refreshParent;
    function refreshParent() {
        window.opener.location.reload();
    }
</script>

<script language="JavaScript">
<!--
function refreshParent() {
  window.opener.location.href = window.opener.location.href;

  if (window.opener.progressWindow)

 {
    window.opener.progressWindow.close()
  }
  window.close();
}
//-->
</script>

资料来源:

打开弹出窗口并在关闭弹出窗口时刷新父页面

http://forums.devarticles.com/javascript-development-22/auto-refresh-parent-window-after-closing-popup-4864.html

弹出窗口关闭时刷新父窗口

于 2013-01-17T08:03:29.900 回答
0

调用refreshParent用户操作为:

function refreshParent() {
     window.opener.location.href = window.opener.location.href;
}
于 2013-01-17T07:59:46.947 回答