Skip to content

Instantly share code, notes, and snippets.

@Jorgelig
Created December 2, 2011 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Jorgelig/1425221 to your computer and use it in GitHub Desktop.
Save Jorgelig/1425221 to your computer and use it in GitHub Desktop.
getURLParameter
//parameter or returns an empty string
jQuery.getURLParameter = function(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search) || [, ''])[1]
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment