Created
December 9, 2016 19:27
-
-
Save awesome/63d30830c6cb72936d67837abb00ae7a to your computer and use it in GitHub Desktop.
deserialize js
This file contains 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 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