js push
$('.main_div').each(function(){ product_id = parseInt($(this).data('id')); product_num = parseInt($(this).data('num')); productList_array.productList.push({"productId":product_id,"quantity":product_num}); }); productList_array_jsonstr = JSON.stringify(productList_array); console.log(productList_array_jsonstr);
相信坚持的力量,日复一日的习惯.