Skip to content

Instantly share code, notes, and snippets.

@danwrong
Created August 26, 2009 15:44
Show Gist options
  • Save danwrong/175591 to your computer and use it in GitHub Desktop.
Save danwrong/175591 to your computer and use it in GitHub Desktop.
$.fn.serializeHash = function() {
var arr = this.serialize();
var hash = {};
$.each(arr.split('&'), function(i, pair) {
var items = pair.split('=');
var key = unescape(items[0]), value = unescape(item[1]);
hash[key] = value;
});
return hash;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment