日期:2014-05-18 浏览次数:20476 次
function openWin()
{
var getValue= showModalDialog("childWin.htm", "egwin", "dialogWidth:420px; dialogHeight:220px;status:no;help:yes");
if (getValue!= null)
{
$("txtGetValue").value=getValue;
}
}
function $(objID)
{
return document.getElementById(objID);
}
------解决方案--------------------
可以通过window.returnValue向打开对话框的窗口返回信息,当然也可以是对象。例如:
test4.htm
===================
<script>
var a = window.showModalDialog("test5.htm")
for(i=0;i<a.length;i++) alert(a[i])
</script>
test5.htm
===================
<script>
function sendTo()
{
var a=new Array("a","b")
window.returnValue = a
window.close()
}
</script>
<body>
<form>
<input value="返回" type=button onclick="sendTo()">
</form>