ajax json demo
$.ajax({
type: "POST",
url: "/store/allotwant/updateAlltById",
data: {
fieldId: $('#fieldId').val(),
fieldName: $('#fieldName').val()
},
cache: false,
dataType: "json",
success: function (res) {
if (res.code == "0") {
layer.msg("保存成功", {
icon: 1
});
} else {
layer.msg(res.msg, {
icon: 2
}
},
error: function () {
layer.msg('请求异常', {
icon: 2
});
}
});