Skip to content

Instantly share code, notes, and snippets.

@awesome
Created December 9, 2016 19:27
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save awesome/63d30830c6cb72936d67837abb00ae7a to your computer and use it in GitHub Desktop.
deserialize js
function deserialize(string) {
var array = string.split('&');
var hash = {};
$.each(array, function(i, val) {
var data = val.split('=');
hash[data[0]] = decodeURIComponent(data[1]);
});
return hash;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment