您的位置:首页 > 其它

window.showModalDialog的传值和返回值

2013-12-13 15:55 435 查看
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();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: