zoukankan      html  css  js  c++  java
  • json function

        //保存商品属性
            function Attributesnext()
            {
                //循环获取属性集值和属性文本框值后保存到数据库的Json
                var attributesInfo = "[";
                var data = $("#hideattributesInfo").val();
              
             
                data = data.substr(0, data.length - 1);
                var arr0 = data.split(';');
                for (var i = 0; i < arr0.length;i++)
                {
                    var arr1 = arr0[i].split(':');
                    var AttributeSetsID = arr1[0];
                    attributesInfo = attributesInfo + "{"AttributeSetsID":"+"""+ $("#tableSkuAttributes").find

    ("#td"+AttributeSetsID).attr("value")+"",";
                    attributesInfo = attributesInfo + ""AttributeSetsValues":" + """ + $("#tableSkuAttributes").find("#td" +

    AttributeSetsID).html() + "",";
                    attributesInfo = attributesInfo+   ""children":[" ;
                    var arr2 = arr1[1].split(',');
                    for (var j = 0; j < arr2.length;j++)
                    {

                        var AttributeID = arr2[j];
                        attributesInfo = attributesInfo + "{"AttributeID":" + """ + $("#tableSkuAttributes").find("#txt" +

    AttributeID).attr("value1") + "",";
                        // attributesInfo = attributesInfo + ""AttributeValues":" + """ + $("#tableSkuAttributes").find("#txt" +

    AttributeSetsID).val() + "",";
                        attributesInfo = attributesInfo + ""AttributeValues":" + """ + $("#tableSkuAttributes").find("#txt" +

    AttributeID).val() + ""},";
                       
                    }
                    attributesInfo = attributesInfo.substr(0, attributesInfo.length - 1);
                    attributesInfo = attributesInfo + "]},"
                  
                }
                attributesInfo = attributesInfo.substr(0, attributesInfo.length - 1);
                attributesInfo = attributesInfo + "]";
                $.post("../Handler/AddGoods.ashx?type=SaveAttribut&GoodsCode=" + $("#GoodsCode").val() + "&GoodsVersions=" +

    $("#GoodsVersions").val() + "&PackingList=" + $("#PackingList").val(), { Introduction: aa }, function (data) {
                    var result = $.parseJSON(data);
                    //    alert(data.d);
                    if (result == "1") {
                        window.location.href = "GoodsManage.aspx";
                    } else {
                        top.Dialog.alert("操作失敗");
                    }
                })
                alert(attributesInfo);
              
            }

  • 相关阅读:
    压缩自编码器具备天然的模式过滤能力
    自编码器天生具备压缩、去噪和生成新样本的能力
    1338. Reduce Array Size to The Half
    442. Find All Duplicates in an Array
    1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold
    1437. Check If All 1's Are at Least Length K Places Away
    695. Max Area of Island
    1414. Find the Minimum Number of Fibonacci Numbers Whose Sum Is K
    1233. Remove Sub-Folders from the Filesystem
    238. Product of Array Except Self
  • 原文地址:https://www.cnblogs.com/zhangweixin/p/4000637.html
Copyright © 2011-2022 走看看