window.showModalDialog的传值和返回值

window.showModalDialog(URL,dialogArgments,features) 打开一个新窗口 

URL为要将打开的网页地址。 
dialogArgments为设定好传递给新视窗网页的参数,可以为任意数据类型。 
features:
certer , dialogHeight, dialogLeft,dialogTop,dialogWidth,help(是否显示help按钮,下同),status,resizeable 
值=1为yes,0为no. 

dialogArgments,可以传递值到新的窗口。 
window.returnValue.可以在showModalDialog开启的窗口关闭后前,回传一个任意类型的值。

1.html

function aa(){
var result = window.showModalDialog("2.html", window, "scroll:1;scrollbar:1;dialogWidth:600px;dialogHeight:550px;help:no;status:no;");
alert(result);
}

2.html

function getCurrentSelect(){
window.returnValue = document.getElementById("queryName").value;
window.close();
}

原文地址:https://www.cnblogs.com/qlong8807/p/3473277.html