Skip to content

Instantly share code, notes, and snippets.

@cgravolet
Created September 11, 2009 18:33
Show Gist options
  • Select an option

  • Save cgravolet/185484 to your computer and use it in GitHub Desktop.

Select an option

Save cgravolet/185484 to your computer and use it in GitHub Desktop.
Get URL Parameter
gup: function(name){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if (results == null) {
return '';
} else {
return results[1];
}
} // gup() - Get URL Param
@GianmarcoCV
Copy link

8 años y le sigo dando uso. Gracias master.

@crisanch
Copy link

como la uso ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment