$.fn.serializeObject = function() {
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name]) {
if (!o[this.name].push) {
o[this.name] = [ o[this.name] ];
}
o[this.name].push(this.value || '');
} else {
o[this.name] = this.value || '';
}
});
return o;
};
form表单数据转为对象方法
最新推荐文章于 2023-11-23 18:21:58 发布