Skip to content

Instantly share code, notes, and snippets.

@spacecowb0y
Created May 10, 2011 12:41
Show Gist options
  • Save spacecowb0y/964396 to your computer and use it in GitHub Desktop.
Save spacecowb0y/964396 to your computer and use it in GitHub Desktop.
Return GET params value
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
return results[1] || false;
}
// $.urlParam('param');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment