js hashmap 和 push

时间:2014-09-10 14:00:00   收藏:0   阅读:354
            var hashMap1 = {};
            $(".productFieldTxt").each(function () {
                if ($(this).val() in hashMap1) {
                    isOk = false;
                    alert("Product Field [" + $(this).val() + "] appears repeatedly.");
                    return false;
                }
                else {
                    hashMap1[$(this).val()] = $(this).val();
                }
            });

    var arrayCO = new Array();
    var CECustomizeOption = new Object();
    CECustomizeOption.ElementId = 0;
    CECustomizeOption.ElementText = $(this).text();
    CECustomizeOption.ElementValue = $(this).val();
    arrayCO.push(CECustomizeOption);
    $(‘#<%=hf_ElementsJson.ClientID %>‘).val(JSON.stringify(arrayCO));//json2序列化,服务器端jss反序列化

  

原文:http://www.cnblogs.com/laozuan/p/3964193.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!