标签:style blog ar io color os sp on 数据
1.ajax()提交json数据代码
var strJson = getStrPayJson(); $.ajax({ type: "POST", url: "/usercenter/paycoupon", contentType: "application/json", dataType: "json", data: JSON.stringify({ "payUsers": strJson }), success: function (jsonResult) { alert(jsonResult); } });
2.组织json数据代码
function getStrPayJson() { var json = []; var arrInput = $("input[name=Coupon]").not(":disabled"); $.each(arrInput, function (i, item) { if (item.value != "") { var obj = { "UserId": item.id, "Coupon": item.value }; json.push(obj); } }); return json; }
标签:style blog ar io color os sp on 数据
原文地址:http://www.cnblogs.com/paulhe/p/4171032.html