有时我们需要在新打开的窗口里面编辑信息,等编辑完了,需要将当前窗口关闭并且刷新父窗口,以使修改生效,本文就是介绍用 javascript 来实现"更新记录后关闭子窗口并刷新父窗口". 父窗口代码: <a href="javascript:void(0)" onclick="window.open('child.html','child','width=400,height=300,left=200,top=200');">打开子窗口&…
一.JS实现关闭当前子窗口,刷新父窗口 JS代码如下: <script> function refreshParent() {  window.opener.location.href = window.opener.location.href;  window.close();   }              </script>…
一.js实现关闭当前子窗口,刷新父窗口 JS代码如下: <script> function refreshParent() {  window.opener.location.href = window.opener.location.href;  window.close();   }              </script> html页面代码如下: <input type="button" id="btn1" class=&qu…
在需要layer.js弹窗口时,当编辑完窗口内容,需要关闭及刷新父窗口时: $("#senddata").click(function(){var id = $('input[name=id]').val();var amount = $('input[name=amount]').val();var star = $('input[name=star]').val();$.post("{:url('admin/card/editPart_Data')}",{id:…
不知道大家有没有碰到类似的问题,当时的你是什么思路来处理这个问题呢?是url,session,cookie,还是…… 今天笔者就遇到了这个问题,当时的想法如:url,session,cookie都尝试过,但是总是不能达到自己理想的目的 最后,在查看网页js资料的时候,看到了用Form.控件id.Click()方法为查询添加遮罩时,有感而发,我们这关闭子页面后,在父页面刷新自己,也可以同样的方法,仅记录…
var childWin = window.open("your URL"); //获取子窗口句柄childWin.onunload = function(){ //onunload是窗口关闭事件 this.opener.location.reload(); //childWin.opener为父窗口,及时刷新} 楼主也可以这样:(直接在子窗口中) window.onunload = function(){ this.opener.location.reload(); }更为简洁...…
iframe中刷新父页面方法及一些按钮刷新代码集合[原创+转]2009-07-23 11:12a页面里iframe了个b页面,我想实现在b页面里一个按钮,一按就刷新a页面,也就是父页面,不是只刷新iframe里面的b页面 哦~ 请问b页面里的<input type="button" class="btn" value=" 返 回 " onclick="history.back();">那个onclick 要怎么写呢…
父页面 : html连接:<a href="javascript:void(0)" onclick="window.open(子页面URL)">js调用的方法: function closeWindow(object, isReload) { object.close(); isReload===true && window.location.reload();}子页面: $('#id').on('click',function(){ /…
父页面js:function btnAdd_onclick() {window.open("xxx.jsp", "","height=600, width=650, top=100, left=200,z-look=yes,toolbar=yes, menubar=no, scrollbars=yes, resizable=yes ,alwaysRaised=yes,location=no, status=yes" );} function re…
window.parent.location.reload(); var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index);…
今天再次使用showModalDialog(),发现了两个问题,一是子窗口如何刷新父窗口,二是窗口的参数问题. 1 子窗口刷新父窗口 如果是window.open();问题就好办,直接用window.opener.location.reload();就搞定了 但是如果是window.showModalDialog(),它里面是没有window.opener的,不能用opener引用父窗口,直接调用用报错. 总结了一下有两种方法可以解决,一是在子窗口中刷新父窗口,二是在子窗口关闭后,父窗口自己刷新…
winform打开子窗体后,在子窗体中刷新父窗体,或者关闭子窗体刷新父窗体,搜集了几个方法,列举如下: 一 . 所有权法 父窗体,名称为“fuForm”,在父窗体中有个公共刷新方法,也就是窗体数据初始化方法.如: public void reLoad_method() { //窗体数据初始化方法,fuForm_Load中的全部操作,调用此方法可实现数据的刷新 } fuForm中打开ziForm时需要设置所有者,就是ziForm的所有者是fuForm,代码如下: ziForm _ziForm =…
window.open窗口关闭后刷新父窗口代码 window.opener.location.href=window.opener.location.href;window.close();…
获取tbody内的一行数据,包括hidden类型的数据$("#tbody_id").find("tr").each(function(){ var tdArr = $(this).children(); var servicename = tdArr.eq(0).find("input").val(); var serviceid = tdArr.eq(0).find("input[type='hidden']").val()…
通常情况下,关闭窗口时不需要对父窗口做任何操作,但如果子窗口是某一对象的修改画面,这时,当关闭子窗体时就需要对父窗口刷新,刷新可以通过三种方式来实现:1,采用window.opener.location.reload(true);刷新父窗口,但是,如果父窗口之前点过某一个按扭或其它控件,此时时常会跳出来一个提示框,非常烦人,这时候,如果页面上有一个功能按钮,我们就可以利用window.opener.__doPostBack('ctl00$contentPlaceHolder1$bt_query'…
通常情况下,关闭窗口时不需要对父窗口做任何操作,但如果子窗口是某一对象的修改画面,这时,当关闭子窗体时就需要对父窗口刷新,刷新可以通过三种方式来实现:1,采用window.opener.location.reload(true);刷新父窗口,但是,如果父窗口之前点过某一个按扭或其它控件,此时时常会跳出来一个提示框,非常烦人,这时候,如果页面上有一个功能按钮,我们就可以利用window.opener.__doPostBack('ctl00$contentPlaceHolder1$bt_query'…
父窗口是由两个部分组成,一个html的table,一部分是extjs的gird. 点击grid面板[增加]按钮将会弹出非模态窗口进行新数据的编辑页面 下面是按钮的触发函数代码: var a = window.showModalDialog(url,window,"dialogWidth:900px;status:no;dialogHeight:480px;minimize:no;maximize:no"); if(a>=0){ winReflesh(store,a); }func…
ThinkPHP 表单提交操作成功后执行JS操作如何刷新父页面或关闭当前页等操作 .操作成功后刷新父页面 $this->assign('jumpUrl', "javascript:window.parent.location.reload();"); $this->success(‘提交成功’); .操作成功后关闭当前页 $this->assign('jumpUrl', "javascript:window.opener=null;window.open(&…
$("#父窗口元素ID",window.parent.document); 对应javascript版本为window.parent.document.getElementByIdx_x("父窗口元素ID"): 取父窗口的元素方法:$(selector, window.parent.document);那么你取父窗口的父窗口的元素就可以用:$(selector, window.parent.parent.document); 类似的,取其它窗口的方法大同小异$(se…
window.showModalDialog刷新父窗口和本窗口的方法及注意:   一.刷新父窗口的方法:    A.使用window.returnValue给父窗口传值,然后根据值判断是否刷新. 在window.showModalDialog窗口页面中用window.returnValue方式设置返回值:       比如:window.returnValue='refresh';         B.在写window.showModalDialog弹出窗口函数时,定义个变量,然后根据变量值进行…
本文实例讲述了layer实现关闭弹出层刷新父界面功能.分享给大家供大家参考,具体如下: layer是一款近年来备受青睐的web弹层组件,她具备全方位的解决方案,致力于服务各水平段的开发人员,您的页面会轻松地拥有丰富友好的操作体验. 方案一: 在layer弹出层中调用父界面重新加载函数 window.parent.location.reload(); var index = parent.layer.getFrameIndex(window.name); parent.layer.close(in…
一.获取页面元素 取父窗口的元素方法:$(selector, window.parent.document); 那么你取父窗口的父窗口的元素就可以用:$(selector, window.parent.parent.document); 类似的,取其它窗口的方法大同小异 $(selector, window.top.document); $(selector, window.opener.document); $(selector, window.top.frames[0].document);…
常用的有:   window.opener.location.reload();    和  window.location.reload(); 浮层内嵌iframe及frame集合窗口,刷新父页面的多种方法   <script language=JavaScript>       parent.location.reload();    </script>   <script language=JavaScript> parent.location.reload();…
浮层内嵌iframe及frame集合窗口,刷新父页面的多种方法   <script language=JavaScript>       parent.location.reload();    </script>   <script language=JavaScript> parent.location.reload(); </script> 弹出子页面   <script language=JavaScript>       window.…
/*Iframe刷新父窗口的几种方式在iframe的子页面中,使用onload刷新父页面的时候,遇到了一些问题. 1.目前来说,测试成功,并且兼容IE6/7和FF的刷新方式. */ <script language=JavaScript> parent.window.location.href="url"; </script> //2.个别情况下出现IE6/7“没有权限”的JS错误提示信息,FF下也出现错误提示.原因不明. <script language…
var winObjEI = window.open("/Invoice/InvoiceViewEI?invoiceid=" + data.InvoiceId); ; //关闭open页面时刷新父页面列表 var loop = setInterval(function () { ) { isClose--; //这里写刷新代码 } }, ); isClose字段保证父页面只在子页面关闭时刷新一次.…
//关闭当前页面 并刷新父页面 var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index) window.parent.location.reload();…
父窗口: ///<summary> ///弹出窗口  ///</summary> ///<param name="sender"></param> ///<param name="e"></param> privatevoid miFuncSet_Click(object sender, RoutedEventArgs e) { WinFuncSetting funcSetting =new W…
在子窗口OnClose() 消息里添加: GetParent()->DestroyWindow();//子窗口关闭 父窗口也同样关闭…
关闭自己 //关闭自己 top.Dialog.close(); 关闭父窗口 //关闭父窗口 parentDialog.parentWindow.close() 往父窗口传值 //在本页面,调用父页面方法getChecked,两个弹框再写一层parentDialog.parentWindows即可 parentDialog.parentWindow.getChecked(row); //父页面定义getChecked方法 function getChecked(row) { } 刷新父页面 //刷…