Created
August 23, 2017 16:54
-
-
Save shaosh/f0b3361b0ba61efdd0f7ec60df91f62e to your computer and use it in GitHub Desktop.
Para query strings in the url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getUrlParams() { | |
var result = {}; | |
var params = (window.location.search.split('?')[1] || '').split('&'); | |
for(var param in params) { | |
if (params.hasOwnProperty(param)) { | |
paramParts = params[param].split('='); | |
result[paramParts[0]] = decodeURIComponent(paramParts[1] || ""); | |
} | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment