关闭子页面刷新父页面

项目中经常用到编辑子页面后刷新父页面,在此记录下来。

分三步:

1,在父页面中要添加页面刷新方法

 function refresh() {
            this.location = this.location;
        }

打开子页面时要用window.open方法,

window.open('a.spx','编辑','width=400,height=600,toolbar=0,scrollbars=2,top=200,left=200');

2,调用父页面中刷新方法

window.opener.refresh();window.opener=null;

3, 关闭子页面调用window.close方法

window.close();

原文地址:https://www.cnblogs.com/langhua/p/3345566.html