子窗体
//得到选中的行并把这些数据组成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为空
求助那位告诉我一下啦 

解决方案 »

  1.   

    在窗体里面这样写window.returnvalue="json字符串"
    window.close()
      

  2.   

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

  3.   

    window.returnValue
    注意大小写
      

  4.   

    window.opener=strDetail=strDetail.substring(0,strDetail.length-1)+"]";\
    哗哗 衰了。这句话问题很大。。高了两个等于号了 昏。。