jquery向後臺傳入json資料
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;
});
}
});