Js弹出showModalDialog窗口返回值或数组

function showMyModalDialog(url, width, height)
{
  showModalDialog(url, ", 'dialogWidth:' + width + 'px;dialogHeight:' + height + 'px;center:yes;status:no;scroll:no;help:no');
}

function showMyModelessDialog(url, width, height)
{
  showModelessDialog(url, ", 'dialogWidth:' + width + 'px;dialogHeight:' + height + 'px;center:yes;status:no;scroll:no;help:no');
}

返回一个值:

var   strr=showModalDialog('hh.asp',0,"dialogWidth:300px;dialogHeight:160px;status:no");   

hh.asp: 

window.returnValue=document.all.name.value;

返回数组: var s=Array(4);或 var s=[1,2,3]; 或 var s=[[1,2],[3,4]];window.returnValue=s;window.close();    
 得到:strr[][]

原文地址:https://www.cnblogs.com/hjtdlx/p/2257335.html