您的位置:首页 > Web前端 > JavaScript

web开发笔记“javascript 刷新父级页面”

2014-11-14 10:07 162 查看
1、window.showModalDialog 方式

首先,第二个参数,传递当前window

然后,弹出页面通过window.dialogArguments 获取传递的参数

最后刷新父级窗口、关闭弹出页面

var parent=window.dialogArguments[0];

parent.reload();



parent.location.href=parent.location.href;



parent.document.execCommand("Refresh");

window.close();

2、window.open 方式

首先,window.open 打开弹出页面

然后,弹出页面关闭时

opener.document.execCommand("Refresh");



window.opener.location.reload();



opener.location.href=opener.location.href;



3、window.showModalDialog /window.open

在打开后直接刷新
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: