Last active
December 20, 2015 22:38
-
-
Save eltiare/6206150 to your computer and use it in GitHub Desktop.
An object serializer for jQuery. I don't know why this isn't already a thing...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.fn.serializeObject = function() { | |
var arr = this.serializeArray(), a, ret = {}; | |
$.each(arr, function(i, a) { ret[a.name] = a.value; }); | |
return ret; | |
} | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment