Created
February 18, 2023 20:42
-
-
Save jlaundry/c7d2218e98a7a59208dc36e842a759bb to your computer and use it in GitHub Desktop.
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 getHashParams() { | |
/** | |
* Get the page hash parameters | |
* @return {Object} a dict of key=value pairs from location.hash | |
*/ | |
let params = {}; | |
let vars = location.hash.substring(1).split('&'); | |
for (let i = 0; i < vars.length; i++) { | |
let kv = vars[i].split('='); | |
params[kv[0]] = kv[1]; | |
} | |
return params; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment