62,072
社区成员
发帖
与我相关
我的任务
分享
//当子页面关闭时,父页面刷新
//子页面代码
Response.Write("<script>window.opener.refresh();window.opener=null;window.close();</script>");
//父页面代码
function refresh()
{
this.location=this.location;
}
<html>
<body>
<script>
function showDialog(){
window.open("dialog.html", "dialogWindow");
return false;
}
</script>
<a href="javascript:void(0)" onClick="showDialog()">Open</a>
<span id="lb1"></span>
</body>
</html>
<html>
<body>
<script>
function feedBack(){
if(window.opener&&window.opener.document){
window.opener.document.getElementById("lb1").innerHTML = "new value";
}
}
</script>
<a href="javascript:feedBack()">Return</a>
</body>
</html>