jquery向后台传入json数据

来源:互联网 发布:语音随机聊天软件 编辑:程序博客网 时间:2024/05/18 16:18
goodsId = getval.split("&")[1].split("=")[1];
  var json = {
  "goodsId" : goodsId
  };
  $.ajax({
type : "POST",
url :"<%=path%>/ShopMyCart/selectMyCartByCondition",
contentType: "application/json; charset=utf-8",
dataType : "json",
/* contentType : "application/json;", */
data : JSON.stringify(json),
dataType: "json",
success : function(data) {
var html = "";
$.each(
data.message,
function(i, m) {
$().html();
$("#hoskeywords").html(m.keyWords);
$("#prepay").html("预付款:"+m.prepay);
$("#productImage").attr("src", m.content);
$("#mount").html("数量:"+m.amount);
$("#phone").html(m.userPhone);
$("#pay").html(m.prepay*m.amount);
$("#hosaddr").html(m.hosDetailedAddr);
$("#buttomprepay").html("¥"+m.prepay*m.amount);
phone = m.userPhone;
prepay = m.prepay;
mount = m.amount;
productId = m.productId;
});


}
});
0 0
原创粉丝点击