/*将表单序列化成一个对象*/

sy.serializeObject = function(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;

你可能感兴趣的:(js)