将表单序列化成json格式
Others 2017-12-29 01:31:33 2017-12-29 01:31:33 2556 次浏览$.fn.serializeObject = function() { var o = {}; 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; };
Links: 87