子窗口关闭时刷新父页面

0 c# asp.net

如何在子窗口关闭时刷新父页面?

小智 5

你会在孩子身上找到这样的剧本.

<script type="text/javascript">

function refreshParent() {

//re-set the parent url to refresh
//window.opener references the parent page

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

}

</script>

 [...]

 // the onunload event fires when the child page is closed
<body onunload=refreshParent(); >
Run Code Online (Sandbox Code Playgroud)