Skip to content

Instantly share code, notes, and snippets.

@maxicecilia
Created April 25, 2014 01:02
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 maxicecilia/11274715 to your computer and use it in GitHub Desktop.
Save maxicecilia/11274715 to your computer and use it in GitHub Desktop.
Simple method to recover parameter values from a URL
$.urlParam = function(href, name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(href);
return results[1] || 0;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment