Skip to content

Instantly share code, notes, and snippets.

@blake-simpson
Created July 19, 2012 13:18
Show Gist options
  • Save blake-simpson/3143863 to your computer and use it in GitHub Desktop.
Save blake-simpson/3143863 to your computer and use it in GitHub Desktop.
Javascript module that returns current URL params ($.params)
(function(){
findURLParams = function() {
var params = {};
location.search.replace(
/([^?=&]+)(=([^&]*))?/g,
function (match, key, full, value) {
params[key] = decodeURIComponent(value);
}
);
return params;
}
$.params = findURLParams();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment