Skip to content

Instantly share code, notes, and snippets.

@MilkZoft
Created January 16, 2012 04:37
Show Gist options
  • Select an option

  • Save MilkZoft/1619094 to your computer and use it in GitHub Desktop.

Select an option

Save MilkZoft/1619094 to your computer and use it in GitHub Desktop.
code.jobs - Get URL parameters - jQuery
$.urlParam = function(name) {
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
if(!results) {
return 0;
}
return results[1] || 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment