JQ表单序列化变成 对象

来源:互联网 发布:分贝计软件 编辑:程序博客网 时间:2024/05/21 06:34

JQ表单序列化变成 对象

function serializeObject(form) {
var o = {};
$.each(form.serializeArray(), function(index) {
if (o[this['name']]) {
o[this['name']] = o[this['name']] + ";" + this['value'];
} else {
o[this['name']] = this['value'];
}
});
return o;
}

 

、、、、、、、、、、、、、

 

 

function serializeObject(form)  调用函数

 

结果变成一个对象