Skip to content

Instantly share code, notes, and snippets.

@ckhatton
Created December 8, 2014 23:07
Show Gist options
  • Save ckhatton/ef4a7e0839c758f3c4da to your computer and use it in GitHub Desktop.
Save ckhatton/ef4a7e0839c758f3c4da to your computer and use it in GitHub Desktop.
Grab query parameters from the URL.
jQuery.extend({
getQueryParameters : function(str) {
return (str || document.location.search).replace(/(^\?)/,'').split("&").map(function(n){return n = n.split("="),this[n[0]] = n[1],this}.bind({}))[0];
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment