jquery将form表单序列化常json

var formData = {};
$.each(form.serializeArray(),function(i, item){
formData[item.name] = item.value;
});

$.ajax({
cache: true,
type: "POST",
url:ajaxCallUrl,
data:$('#yourformid').serialize(),// 你的formid
async: false,
error: function(request) {
alert("Connection error");
},
success: function(data) {
$("#commonLayout_appcreshi").parent().html(data);
}
});

原文地址:https://www.cnblogs.com/lovezhaolei/p/3818939.html