传回来的值可以是数组1.html: <script> function window.onunload() { var a = new Array("Hello", "World"); window.returnValue = a; } </script>2.html: var x = showModalDialog("1.html"); alert(x(0)); alert(x(1));
sorry, should bevar x = showModalDialog("1.html"); if(x && x.length) { alert(x[0]); alert(x[1]); }
<script>
function window.onunload()
{
var a = new Array("Hello", "World");
window.returnValue = a;
}
</script>2.html:
var x = showModalDialog("1.html");
alert(x(0));
alert(x(1));
if(x && x.length)
{
alert(x[0]);
alert(x[1]);
}
ShowModalDialog()打开的页面 window.returnValue=str1+"@"+str2+"@"+str3+"@"+str4主页面中
msg=showModalDialog('pop.htm','','dialogWidth=360px;dialogheight=120px;status:no;help:no');
msg.split("@") 就可以将得到的值分割成一个新数组。
但是我无法保证用户的输入中是否也有这个字符串,您能否提供一些平常极少使用或是靠正常输入无法输入的字符或字符串。
to saucer(思归)
I 'll try it.
中间的这个特殊符号,你可以不局限于英文符号,比如中文汉字也行呀!
▲△■□▼▽◆◇○◎●◣◢★◤◥☆☉♀♂〇▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▓妳
这些符号用户一般是不会输入的,你自己再发挥一下。