Sha256: 08a40a02bef57c6ef69371c0567917234871d5245298d72571806796e32f2d06

Contents?: true

Size: 783 Bytes

Versions: 6

Compression:

Stored size: 783 Bytes

Contents

/*!
 * jQuery serializeObject - v0.2 - 1/20/2010
 * http://benalman.com/projects/jquery-misc-plugins/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */

// Whereas .serializeArray() serializes a form into an array, .serializeObject()
// serializes a form into an (arguably more useful) object.

(function($,undefined){
  '$:nomunge'; // Used by YUI compressor.
  
  $.fn.serializeObject = function(){
    var obj = {};
    
    $.each( this.serializeArray(), function(i,o){
      var n = o.name,
        v = o.value;
        
        obj[n] = obj[n] === undefined ? v
          : $.isArray( obj[n] ) ? obj[n].concat( v )
          : [ obj[n], v ];
    });
    
    return obj;
  };
  
})(jQuery);

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
boot-cli-1.0.0 lib/templates/wordpress/wp-includes/js/jquery/jquery.serialize-object.js
boot-cli-0.3.1 lib/templates/wordpress/wp-includes/js/jquery/jquery.serialize-object.js
boot-cli-0.3.0 lib/templates/wordpress/wp-includes/js/jquery/jquery.serialize-object.js
stump-cli-0.1.3 lib/wp/wp-includes/js/jquery/jquery.serialize-object.js
stump-cli-0.1.2 lib/wp/wp-includes/js/jquery/jquery.serialize-object.js
stump-cli-0.1.1 lib/wp/wp-includes/js/jquery/jquery.serialize-object.js