做项目的时候,需要实现这样一个功能:弹出一个窗口,对该窗口进行操作,操作结束后关闭该窗口,对父窗口进行刷新操作;纠结了小一会儿呢.查了一下资料,然后自己实践一下,成功了,下面将我查到的资料分享一下吧;
<span style="font-family: 'Microsoft YaHei'; font-size: 18px;">用iframe、弹出子页面刷新父页面 iframe parent.location.reload(); 弹出子页面 window.opener.location.reload();<span style="color: rgb(255, 0, 0);">--这个方法是我尝试过的,可以成功实现我想要的功能,其他的没有尝试,不能保证绝对的正确.</span> 子窗口刷新父窗口 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>");</span>