Skip to content

Instantly share code, notes, and snippets.

@jcartledge
Created April 24, 2012 11:25
Show Gist options
  • Save jcartledge/2478891 to your computer and use it in GitHub Desktop.
Save jcartledge/2478891 to your computer and use it in GitHub Desktop.
function querystring(str) {
var qs = {};
str.match(/^[\?]?(.*)$/)[1].split('&').map(function(pair) {
pair = pair.split('=');
qs[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
});
return qs;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment