Skip to content

Instantly share code, notes, and snippets.

@mertcangokgoz
Created January 24, 2019 05:05
Show Gist options
  • Save mertcangokgoz/0d9a277983e37584d647f83605c831e1 to your computer and use it in GitHub Desktop.
Save mertcangokgoz/0d9a277983e37584d647f83605c831e1 to your computer and use it in GitHub Desktop.
function getUrlVars() {
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment