2 * jQuery serializeObject - v0.2 - 1/20/2010
3 * http://benalman.com/projects/jquery-misc-plugins/
5 * Copyright (c) 2010 "Cowboy" Ben Alman
6 * Dual licensed under the MIT and GPL licenses.
7 * http://benalman.com/about/license/
10 // Whereas .serializeArray() serializes a form into an array, .serializeObject()
11 // serializes a form into an (arguably more useful) object.
13 (function($,undefined){
14 '$:nomunge'; // Used by YUI compressor.
16 $.fn.serializeObject = function(){
19 $.each( this.serializeArray(), function(i,o){
23 obj[n] = obj[n] === undefined ? v
24 : $.isArray( obj[n] ) ? obj[n].concat( v )