Created
October 26, 2018 13:16
-
-
Save clovisdasilvaneto/a9ee9ad28b21ed6cb0a8fe1faa55e8a6 to your computer and use it in GitHub Desktop.
This file contains 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
getSearchParameters() { | |
var prmstr = window.location.search.substr(1); | |
return prmstr != null && prmstr != "" ? this.transformToAssocArray(prmstr) : {}; | |
} | |
transformToAssocArray( prmstr ) { | |
var params = {}; | |
var prmarr = prmstr.split("&"); | |
for ( var i = 0; i < prmarr.length; i++) { | |
var tmparr = prmarr[i].split("="); | |
params[tmparr[0]] = tmparr[1]; | |
} | |
return params; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment