简单回答:自己看,不再赘述
用iframe、弹出子页面刷新父页面
iframe
parent.location.reload();
弹出子页面
window.opener.location.reload();
子窗口刷新父窗口
self.window.opener.locaction.reload();
刷新一open()方法打开的窗口
window.opener.location.href = window.opener.location.href
刷新以winodw.showModelDialog()方法打开的窗口
window.parent.dialogArguments.document.execCommand('Refresh');
或
Response.Write("<script>window.location.href = window.location.href</script>");
刷新本页Response.Write("<script>window.location.href=window.location.href; </script>");
刷新父页和本页面:
Response.Write("<script>alert('提交成功!');window.location.href=window.location.href;window.opener.location=window.opener.location;</script>");
// 关闭窗口.
function closeWin(){
// 可能存在frame页面,所以要引用top窗口.
var win = top.window;
try{
// 聚焦.
if(win.opener) win.opener.focus();
// 避免IE的关闭确认对话框.
win.opener = null;
}catch(ex){
// 防止opener被关闭时代码异常。
}finally{
win.close();
}
}
// 刷新打开本窗口的opener窗口.
function refreshOpener(){
// 可能存在frame页面,所以要引用top窗口.
var win = top.window;
try{
// 刷新.
if(win.opener) win.opener.location.reload();
}catch(ex){
// 防止opener被关闭时代码异常。
}
}
// 刷新opener窗口后关闭自己。
function refreshOpenerAndCloseMe(){
refreshOpener();
closeWin();
}