zoukankan      html  css  js  c++  java
  • 子窗口刷新父窗口然后关闭

    页面a里有个按钮点上就用window.showModalDialog(“b.html”)打开页面b.html这个页面里有个提交form点提交以后,就在父页A里增加一条记录,算新父目录然后父目录里能看见新增加的记录,关闭子页面,怎么实现,好像就是子窗口刷新父窗口然后关闭

    1 history.go(0)
    2 location.reload()
    3 location=location
    4 location.assign(location)
    5 document.execCommand('Refresh')
    6 window.navigate(location)
    7 location.replace(location)
    8 document.URL=location.href
    这几个都可以刷新
    比如:父窗口
    <a href="javascript:void(0)" onclick="window.open('child.html','child','width=400,height=300,left=200,top=200');">打开子窗口</a>

    子窗口
    <script language="JavaScript" type="text/javascript">
    <!--
    function refreshParent() {
    window.opener.location.href = window.opener.location.href;
    if (window.opener.progressWindow)
    {
    window.opener.progressWindow.close();
    }
    window.close();
    } //-->
    </script>

    <a href="javascript:void(0)" onclick="refreshParent()">刷新父窗口并关闭当前窗口</a>

  • 相关阅读:
    hdu 5972 Regular Number
    hdu 5971 Wrestling Match
    福大软工 · BETA 版冲刺前准备(团队)
    福大软工 · 第十一次作业
    Alpha 冲刺 (10/10)
    Alpha 冲刺 (9/10)
    Alpha 冲刺 (8/10)
    Alpha 冲刺 (7/10)
    Alpha 冲刺 (6/10)
    Alpha 冲刺 (5/10)
  • 原文地址:https://www.cnblogs.com/wubin264/p/1394261.html
Copyright © 2011-2022 走看看