window.showModalDialog父子窗口参数传递

在开发过程中遇到window.showModalDialog()打开的模态对话框需要从子窗口传递返回值给父窗口中的某个插件,开始想通过window.opener得到,但是试了几次得不到,后来发现原来在当前打开窗口(子窗口)中可以通过window.returnValue=指定返回值;window.close();之后父窗口可以使用var result = window.showModalDialog(url,window,"dialogWidth=600px;dialogHeight=500px;center=yes;resizable=no;status=no;scroll=yes");来接收打开窗口的返回值。然后把此返回值附加给某个组件或某些组件。



附带参数说明:

参考http://www.cnblogs.com/zhangyi85/archive/2009/09/03/1559594.html

window.showModalDialog父子窗口参数传递,布布扣,bubuko.com

时间: 2024-08-10 17:18:19

window.showModalDialog父子窗口参数传递的相关文章

JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作

一.Iframe 篇 公共部分 //父对象得到子窗口的值 //ObjectID是窗口标识,ContentID是元素ID function GetValue(ObjectID,ContentID) { var IsIE = (navigator.appName == 'Microsoft Internet Explorer') if(IsIE) {//如果是IE alert(document.frames(ObjectID).document.getElementById(ContentID).i

总结js(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作

http://hi.baidu.com/yashua839/blog/item/131fdb2fe547ef221f3089af.html一.Iframe 篇 //&&&&&&&&&&&&&&&&&&&&公共方法开始&&&&&&&&&&&&&&a

window.showModalDialog 子窗口数据回填父窗口

window.open 打开窗口时,可以很轻松的取得其父窗口.项目中需要用 showModalDialog打开窗口,想要取得父窗口值,而且还要在 open的基础上修改 为了不让 window.returnValue 所返回的值不是那么烦索,就要想办法如何用showModalDialog 打开的窗口取得其父窗口.合理利用 showModalDialog 传入的参数便可以解决这个问题. 话不多说,看例子: 父窗口:a.html <html>     <head>         <

父窗口window.showModalDialog传值 子窗口window.returnValue返回值

父窗口打开子窗口页面: var fatherWindow = document.all.dealReason;//想传的值 win = window.showModalDialog(strUrl, fatherWindow, "dialogWidth=800px;dialogHeight=600px;"); //strUrl是子窗口页面,fatherWindow是想传的值,win是子窗口返回的值document.all.dealReason.value = win; 子窗口: var

window.showModalDialog刷新父窗口和本窗口的方法及注意

window.showModalDialog刷新父窗口和本窗口的方法及注意:   一.刷新父窗口的方法:    A.使用window.returnValue给父窗口传值,然后根据值判断是否刷新. 在window.showModalDialog窗口页面中用window.returnValue方式设置返回值:       比如:window.returnValue='refresh';         B.在写window.showModalDialog弹出窗口函数时,定义个变量,然后根据变量值进行

IE 中创建 子窗口 传值 与接收值 【window.showModalDialog】

父窗口 创建一个窗口 var backinfo = window.showModalDialog('UserSelect.aspx', '', 'dialogHeight=600px; dialogWidth= 600px; edge=Raised; center=Yes;resizable= No; status= no;help=no'); 子窗口 调用JS关闭自身并返回值 function SelectCompany(obj) {                            wi

调用window.showModalDialog(),不能调用window.location.reload()和提交表单时打开新窗口的解决方案

我们往往会遇到这种情况,就是用 window.showModalDialog弹出的窗口,在里面提交form表单时,或者location.href=""时,都会新弹出窗口,很恶心的. 注:showModalDialog窗口与window.open打开的窗口刷新本窗口时不同,showModalDialo窗口也不能用F5刷新,也没有右 键操作 建议采用以下方式: A. 在模式窗口页面中加入:      <base target="_self"> //在html

打开新窗口,window.open 和window.showModalDialog

window.open: window.open是非阻态窗口,也叫非模态窗口,也就是说当你打开window.open这个子窗口后,还可以切换去操作父窗口. 一般的格式是这样的: <span style="font-size:14px;"><strong>window.open('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrol

window.showModalDialog()之返回值

window.showModalDialog的基本用法 showModalDialog() (IE 4+ 支持) showModelessDialog() (IE 5+ 支持) window.showModalDialog()方法用来创建一个显示HTML内容的模态对话框. window.showModelessDialog()方法用来创建一个显示HTML内容的非模态对话框. 使用方法: vReturnValue = window.showModalDialog(sURL [, vArgument