JS刷新弹出窗口

JavaScript013

JS刷新弹出窗口,第1张

用window.opener关联父级窗口,父级窗口的刷新你可以用window.opener.location.reload()。

但是window.opener.location.reload()这句话在method=get的情况下根本不起作用,但是换成method=post,则主窗口会弹出一个对话框,要求点击确定才能刷新,可以试一下:window.opener.location.href=window.opener.location.href

<head><base target="_self" /></head>

<!-- 在HEAD标记中加入 <base target="_self" /> -->

<a id="reload" href="SelectRoleUser.aspx" style="display:none"></a>

<a onclick="reload()">reload</a>

<script>

function reload(){

document.getElementById("reload").click()

}

</script>

通过调用隐藏的超链接 实现