• 用js在两个页面之间传值


    子窗体中给父窗体动态创建表:

    <script>
            function Product(product_name,product_id,product_describe,AMOUNT_UNIT,COST_PRICE)
            {
               
               var arry= new Array("1",product_name,product_id,product_describe,AMOUNT_UNIT,COST_PRICE);
               var Hiddfield=window.opener.document.getElementById("Hddf");
               var table = window.opener.document.getElementById("tbDispalys");
               var rowlength=table.rows.length;
               for (var i=0;i<rowlength ;i++ )
       {
        if(table.rows[i].cells[2].innerText==product_id)//已存在
        {
         return;
        }
       }
               var tr=table.insertRow();
               var td=tr.insertCell();
               td.innerHTML="<input type='checkbox' name='xuanze'/>";
               for(var j=1;j<7;j++)
               {
                    var td1=tr.insertCell();
                    if(j==4)
                    {
                        td1.innerHTML="<input type='text' value=1 class='textLine' />";
                        Hiddfield.value+=","+"1";
                       
                    }
                    else if(j>4)
                    {
                        td1.innerText=arry[j-1];
                        Hiddfield.value+=","+arry[j-1];                   
                    }
                    else
                    {
                        td1.innerText=arry[j];
                        Hiddfield.value+=","+arry[j];
                    }
               }
               var td2=tr.insertCell();
               td2.innerText=arry[5];  
               Hiddfield.value+=","+arry[5]+";";
            }
        </script>

  • 相关阅读:
    HDU——1215七夕节(因数和)
    UVa——400Unix ls(字典序文本处理输出iomanip)
    廖雪峰Java5集合-3Map-Properties的使用
    python图片和字符串的转换
    廖雪峰Java5集合-3Map-1使用Map
    廖雪峰Java5集合-2List-2编写equals方法
    廖雪峰Java5集合-1Java集合简介-1Java结合简介
    廖雪峰Java4反射与泛型-3泛型-7泛型和反射
    廖雪峰Java4反射与泛型-3范型-6super通配符
    廖雪峰Java4反射与泛型-3范型-5extends通配符
  • 原文地址:https://www.cnblogs.com/lyanet/p/2817059.html
Copyright © 2020-2023  润新知