showModalDialog页面怎么得到子窗体传过来的JSON数组呢?

子窗体

//得到选中的行并把这些数据组成json数组 传到父窗体
function selectid(){

var strDetail="[";
$(".sel:checked").each(function (){

var t2 = document.getElementById("t2");
strDetail=strDetail+"{id:'"+t2.rows[this.value].cells[1].innerHTML+
"',name:'"+t2.rows[this.value].cells[2].innerHTML+
"',price:'"+t2.rows[this.value].cells[3].innerHTML+
"',sum:'"+t2.rows[this.value].cells[4].innerHTML+"'},";


//alert(t2.rows[this.value].cells[1].innerHTML);
});
window.opener=strDetail=strDetail.substring(0,strDetail.length-1)+"]";
window.close();




父窗体

var vnull = window.showModalDialog("/Store/goods.dog=getProduct&page=1", "neww1","location=yes,toolbar=no,resizeable=no,top=400,left=400,scrollbars=no,width=500,height=500,screenX=6000,screenY=1000");

var stu = eval("("+vnull+")");
t2.rows[lastindex+1].cells[2].innerHTML=""+stu.name;
t2.rows[lastindex+1].cells[3].innerHTML=""+stu.price;

报错什么stu.name为空
求助那位告诉我一下啦

  • window.opener=strDetail=strDetail.substring(0,strDetail.length-1)+"]";
    window.close();
    showModalDialog 不支持opener的
    改成
    window.returnvalue="json字符串"
    window.close()