在A窗口中打开B窗口,在B窗口中操作完以后关闭B窗口,同时自动刷新A窗口
2011-04-19 17:45
501 查看
function closeWin() {
hasClosed = true;
var frame=window.opener.parent.document.frames.item('mainFrame')
if(null != frame)
window.opener.parent.document.frames.item('mainFrame').location.href = window.opener.location.href;
}else{
window.opener.location = "javascript:reloadPage();";
}
//window.opener.top.mainFrame.location="javascript:reloadPage();";
//self.opener.frames.mainFrame.location.reload(true);
window.opener = null;
window.close();
}
function window.onbeforeunload(){
if (!hasClosed) {
var frame=window.opener.parent.document.frames.item('mainFrame')
f(null != frame){
window.opener.parent.document.frames.item('mainFrame').location.href = window.opener.location.href;
}else{
window.opener.location = "javascript:reloadPage();";
}
window.opener = null;
}
}
function reloadPage() {
history.go(0);
document.execCommand("refresh")
document.location = document.location;
document.location.reload();
}
hasClosed = true;
var frame=window.opener.parent.document.frames.item('mainFrame')
if(null != frame)
window.opener.parent.document.frames.item('mainFrame').location.href = window.opener.location.href;
}else{
window.opener.location = "javascript:reloadPage();";
}
//window.opener.top.mainFrame.location="javascript:reloadPage();";
//self.opener.frames.mainFrame.location.reload(true);
window.opener = null;
window.close();
}
function window.onbeforeunload(){
if (!hasClosed) {
var frame=window.opener.parent.document.frames.item('mainFrame')
f(null != frame){
window.opener.parent.document.frames.item('mainFrame').location.href = window.opener.location.href;
}else{
window.opener.location = "javascript:reloadPage();";
}
window.opener = null;
}
}
function reloadPage() {
history.go(0);
document.execCommand("refresh")
document.location = document.location;
document.location.reload();
}
相关文章推荐
- 在A窗口中打开B窗口,在B窗口中操作完以后关闭B窗口,同时自动刷新A窗口
- 用javascript实现始终保持打开同一个子窗口以及关闭父窗口同时自动关闭所有子窗口
- 用javascript实现始终保持打开同一个子窗口以及关闭父窗口同时自动关闭所有子窗口
- IE6中,一个Button同时打开两个下载窗口,并且可以自动关闭
- 父窗口打开子窗口,子窗口关闭后自动刷新父窗口
- 始终保持打开同一个子窗口以及关闭父窗口同时自动关闭所有子窗口
- 关于父窗口、子窗口的操作(如关闭、打开、调用方法、刷新等等)
- ASP.NET关闭当前窗口同时打开一个新窗口
- VS2005串口通信程序打开多余的文件,导致窗口自动关闭
- 子窗口保存修改并关闭,同时刷新父窗口
- 关闭弹出模态窗口以后刷新父窗口
- ASP.NET关闭当前窗口同时打开一个新窗口
- JS 打开新窗口没有工具栏 地址栏,同时关闭当前窗口
- updatepanel控件中弹出子窗口,子窗口操作成功后自动关闭并刷新父页面
- 学生选课系统中关于窗口关闭又打开不刷新
- scala文件操作--自动关闭打开的资源,读取properties文件
- 用showModalDialog打开的窗口关闭时刷新父页面
- 模态/非模态 窗口关闭自己同时刷新父页面
- [转载]ASP.NET关闭当前窗口同时打开一个新窗口
- C#关闭一个窗口的同时打开另一个窗口