先执行
document.location.replace = “/”;
在执行
window.opener.location.href=window.opener.location.href;
window.close();
IE支持这种写法
其他浏览器没有执行document.location.replace = “/”; 执行了
window.opener.location.href=window.opener.location.href;
window.close();
关闭子窗口自动刷新父级窗口
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
3条回答 默认 最新
斯洛文尼亚旅游 2017-04-19 03:46关注repalce是函数。。
document.location.replace="/"改为document.location.replace("/")
而且你关闭了窗口还replace干嘛,要先刷新父页再close,replace会发生跳转也可能导致父页刷新的js不执行,刷新要放第一句来执行
window.opener.location.href=window.opener.location.href; document.location.replace("/") window.close();解决 无用评论 打赏 举报