Skip to content

Instantly share code, notes, and snippets.

@dubbs
Created September 20, 2011 22:37
Show Gist options
  • Save dubbs/1230639 to your computer and use it in GitHub Desktop.
Save dubbs/1230639 to your computer and use it in GitHub Desktop.
jquery get url param
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (!results){ return null; }
return results[1] || null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment