JQ表单序列化变成 对象

时间:2017-06-07 09:14:58   收藏:0   阅读:290

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)  调用函数

 

结果变成一个对象

 

原文:http://www.cnblogs.com/nns4/p/6955241.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!