主页面:father.html
<html>
<body>
<script type="text/javascript">
var strFeatures = "dialogWidth=800px;dialogHeight=500px;resizable=yes;center=yes";
var ret=window.showModalDialog("b.html",'', strFeatures);
alert(ret instanceof Array)
</script>
</body>
</html>
结果为flase,也就是说返回对象已经不是数组对象,只是一个带有length属性的特殊对象,不能对它使用splice()等数组方法了。
弹窗:b.html
<html>
<head></head>
<body>
<button type="button" οnclick='sendDataA()' class="btn_fun" >提交</button>
<script type="text/javascript">
function sendDataA()
{
window.returnValue=[{'x':'y','id':0},{'z':'v','id':1}];;
window.close();
}
</script>
</body>
</html>