$.fn.serializeObject = function()
{
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name] !== undefined) {
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;
};
表单序列化的数据转成对象
猜你喜欢
转载自blog.csdn.net/qq_38651504/article/details/86155329
今日推荐
周排行