今天遇到一个好玩的东西,废话不说,直接看代码:
在test1中调用第二个页面test2:
result = window.showModalDialog(url
,"","dialogTop:0px;dialogLeft:0px;dialogWidth:100px;dialogHeight:100px;status:no;resizable:yes");
test2中,完事儿返回数据(如果在此页中有<form action="" method="post"></form>行为,它会自动打开一个新页面,需要在<head></head>之间加入<base target="_self">,将本页中跳转都需要写成target="",即可。):
window.returnValue ="1,2,3
";
test1中,回显返回的数据:
if(typeof(result )!='undefined'){
var list = tmp.split(",");
document.form1.KJNAME
.value=list[0]; //在页面控件中显示该数据.
...
}
showModalDialog("",window,"");可以利用这个window对象调用 写父页面的方法。在子页中,利用var winOpener = window.dialogArguments;得到这个对象。eg: winOpener.showNum("aaaa");//用来调用你页面的东西。
分享到:
相关推荐
This is a `window.showModalDialog()` shim using a modal HTML5 `<dialog>` element and ECMAScript 6 Generators. It was tested in the latest Google Chrome with the *Enable Experimental JavaScript* flag ...
解决三层或心上showModalDialog的问题_2
解决三层或心上showModalDialog的问题_js
showModalDialog及dialogArguments使用
div层实现showModalDialog
showModalDialog参数传递和获
showModalDialog和showModelessDialog使用心得
Selenium目前没有提供对IE模态对话框(即通过showModalDialog方法打开的弹出对话框)的处理。原因在于,模态对话框会将父页面的 JS挂起,直至对话框处理完毕才会继续执行父页面JS。因为Selenium的底层实现是基于JS的,...
解决谷歌浏览器37+版本window.showModalDialog方法失效问题,最终版本。 10分你值得拥有
showModalDialog参数详解 基本介绍: showModalDialog() (IE 4+ 支持) showModelessDialog() (IE 5+ 支持) window.showModalDialog()方法用来创建一个显示HTML内容的模态对话框。 window.showModelessDialog()...
解决三层或心上showModalDialog的问题
showModalDialog刷新窗口的例子
网上找了好几个小时没有找到解决办法。最终还是自己解决了。...这样做就是用超链接把返回url转递到用showModalDialog打开的新窗口中,当showModalDialog返回时指到转来的url,最终不刷新父窗口。......
使用window.showModalDialog的程序员都知道,该方法可返回值。但是如果遇到跨域时,就返回为underfine。本文档通过iframe镶嵌页面解决该问题。
window.showModalDialog的基本用法
DIV 实现showModalDialog效果,内加树形效果
ShowModalDialog函数的功能: 使用方法: 参数说明:
javascript代码模块之\Window.ShowModalDialog使用手册
主要介绍showModalDialog的用法和参数的传递