Skip to content

Instantly share code, notes, and snippets.

@cmatskas
Created January 12, 2016 09:37
Show Gist options
  • Save cmatskas/5804bdff1e485af22caf to your computer and use it in GitHub Desktop.
Save cmatskas/5804bdff1e485af22caf to your computer and use it in GitHub Desktop.
ParseUrl.js
var parseQueryString = function(url) {
var urlParams = {};
url.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function($0, $1, $2, $3) {
urlParams[$1] = $3;
}
);
return urlParams;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment