『壹』 子窗口刷新父窗口然后关闭
1 history.go(0)
2 location.reload()
3 location=location
4 location.assign(location)
5 document.execCommand('Refresh')
6 window.navigate(location)
7 location.replace(location)
8 document.URL=location.href
这几个都可以刷新
比如:父窗口
<a href="javascript:void(0)" onclick="window.open('child.html','child','width=400,height=300,left=200,top=200');">打开子窗口</a>
子窗口
<script language="JavaScript" type="text/javascript">
<!--
function refreshParent() {
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow)
{
window.opener.progressWindow.close();
}
window.close();
} //-->
</script>
<a href="javascript:void(0)" onclick="refreshParent()">刷新父窗口并关闭当前窗口</a>
『贰』 java中如何使“点击子窗口的一个按钮时可以退回到父窗口并关闭此子窗口”
你可以在父子窗口同时分别添加main方法
这样耦合度更低
父子没有任何联系
然后在子窗口按钮中用类名调用
父窗口main方法
同时调用子窗体setVisible(false);
就行了
『叁』 jsp从子窗口跳转到父窗口
在页面加一个javascript
if(self!=top){
window.parent.document.location.href = document.location.href;
}
就可以了