有时我们需要在新打开的窗口里面编辑信息,等编辑完了,需要将当前窗口关闭并且刷新父窗口,以使修改生效,本文就是介绍用 javascript 来实现"更新记录后关闭子窗口并刷新父窗口".

父窗口代码:

  1. <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">

  1. <!--
  2. function refreshParent()
  3. {
  4. window.opener.location.href = window.opener.location.href;
  5. if (window.opener.progressWindow)
  6. {
  7. window.opener.progressWindow.close();
  8. }
  9. window.close();
  10. }
  11. //-->
  12. </script>
  13.  
  14. <a href="javascript:void(0)" onclick="refreshParent()">刷新父窗口并关闭当前窗口</a>
  15.  

更新记录后关闭子窗口并刷新父窗口的Javascript的更多相关文章

  1. JS实现关闭当前子窗口,刷新父窗口

    一.JS实现关闭当前子窗口,刷新父窗口 JS代码如下: <script> function refreshParent() {  window.opener.location.href = ...

  2. JS实现关闭当前子窗口,刷新父窗口及调用父窗口的方法

    一.js实现关闭当前子窗口,刷新父窗口 JS代码如下: <script> function refreshParent() {  window.opener.location.href = ...

  3. layer.js关闭子窗口及刷新父窗口

    在需要layer.js弹窗口时,当编辑完窗口内容,需要关闭及刷新父窗口时: $("#senddata").click(function(){var id = $('input[na ...

  4. js ShowDialogModal 关闭子页面并刷新父页面,保留查询条件

    不知道大家有没有碰到类似的问题,当时的你是什么思路来处理这个问题呢?是url,session,cookie,还是…… 今天笔者就遇到了这个问题,当时的想法如:url,session,cookie都尝试 ...

  5. js window.open()实现打印,如何在关闭打印窗口时刷新父窗口

    var childWin = window.open("your URL"); //获取子窗口句柄childWin.onunload = function(){ //onunloa ...

  6. iframe嵌入的子页面如何刷新父窗口

    iframe中刷新父页面方法及一些按钮刷新代码集合[原创+转]2009-07-23 11:12a页面里iframe了个b页面,我想实现在b页面里一个按钮,一按就刷新a页面,也就是父页面,不是只刷新if ...

  7. web 打开子窗口提交数据或其他操作后 关闭子窗口且刷新父窗口实现

    父页面 : html连接:<a href="javascript:void(0)" onclick="window.open(子页面URL)">js ...

  8. js关闭子窗口,刷新父窗口

    父页面js:function btnAdd_onclick() {window.open("xxx.jsp", "","height=600, wid ...

  9. layer关闭当前窗口并刷新父窗口

    window.parent.location.reload(); var index = parent.layer.getFrameIndex(window.name); parent.layer.c ...

随机推荐

  1. checkbox设置单选

    http://blog.sina.com.cn/s/blog_4550f3ca010137td.html $("*")  ‘表示获取所有对象   $("#XXX" ...

  2. Ingress 记萌新的第一次连多重(xjbl)

    之前为了升七,ArtanisWei学长告诉我可以去紫金园雕塑[这是什么地方啊],顺带靠卖萌骗了一桶key 于是屁颠屁颠的跑去按照群里攻略开始连多重[馒头 by handsomepeach],连了一百年 ...

  3. String Mybatis 多数据源配置

    做项目用到了多数据源的配置,有时候不用就忘记了,自己做下备份以防止忘记. 在配置文件中: <bean id="ds1" class="org.apache.comm ...

  4. PHP初步(上)

    一.php语法 PHP是一种嵌入式脚本语言,所以,我们需要标记出哪些是PHP代码,哪些是html代码.当html和php代码进行混编的时候,文件必须要以php结尾(否则Apache不会将这个文件交给p ...

  5. 利用反射模拟一个spring的内部工作原理

    这个简单的案例是实行了登录和注册的功能,没有链接数据库.  在bean中id 是唯一的,id和name的区别在于id不能用特殊字符而name可以用特殊字符,比如:/-\.... package com ...

  6. stella mccartney falabella foldover tote a few eye observed

    Lately, the particular Heyuan City Courtroom retrial, in order to commit the criminal offense of cou ...

  7. leetcode 日记 4sum java

    整体思路同之前的一样,依然采取降低维度的方式进行 public List<List<Integer>> solution(int nums[], int target) { L ...

  8. Dotspatial 创建面状图层

    using DotSpatial.Controls;using DotSpatial.Data;using DotSpatial.Data.Forms;using DotSpatial.Plugins ...

  9. 清除mysql表中数据

    delete from 表名; truncate table 表名; 不带where参数的delete语句可以删除mysql表中所有内容,使用truncate table也可以清空mysql表中所有内 ...

  10. css3弹性盒子温习

    弹性盒子由弹性容器(Flex container)和弹性子元素(Flex item)组成. 弹性容器通过设置 display 属性的值为 flex 或 inline-flex将其定义为弹性容器. 弹性 ...