HTML form for multiple objects when converting to JSON
问题 Edited: $.fn.serializeObject = function() { var o = {}; var a = this.serializeArray(); $.each(a, function() { var value = this.value || ''; if (/^\d+$/.test(value)) value = +value; if (o[this.name] !== undefined) { if (!o[this.name].push) { o[this.name] = [o[this.name]]; } o[this.name].push(value); } else { o[this.name] = value; } }); return o; };` Edited to hopefully make clearer. Having difficulty wrapping my head around this - sleep deprivation = madness. I have a form that simply