Skip to content

Instantly share code, notes, and snippets.

@db
Last active September 25, 2015 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save db/995102 to your computer and use it in GitHub Desktop.
Save db/995102 to your computer and use it in GitHub Desktop.
Get querystring value
var getQueryString = function(name) {
var pairs = window.location.search.substring(1).split("&"), pair;
for ( var i = 0; i < pairs.length; i++) {
pair = pairs[i].split("=");
if (pair[0] == name) return pair[1];
}
return null;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment