Skip to content

Instantly share code, notes, and snippets.

@d4rkr00t
Created February 28, 2014 13:48
Show Gist options
  • Save d4rkr00t/9271411 to your computer and use it in GitHub Desktop.
Save d4rkr00t/9271411 to your computer and use it in GitHub Desktop.
Get page query parameters
window.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