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>

  • 相关阅读:
    tomcat log
    关于 终端 ls 命令 不能区分文件和目录的问题
    画幅
    透视
    焦距和等效焦距
    滚动条插件mCustomScrollbar
    网页优化总结
    CSS3中translate、transform和translation的区别和联系
    Less的学习和使用
    Koala工具的使用说明
  • 原文地址:https://www.cnblogs.com/wubin264/p/1394261.html
Copyright © 2011-2022 走看看