diff options
Diffstat (limited to 'auth/hash.js')
-rw-r--r-- | auth/hash.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/auth/hash.js b/auth/hash.js new file mode 100644 index 0000000..7cb701a --- /dev/null +++ b/auth/hash.js @@ -0,0 +1,12 @@ +function getHashValue(key) { + // http://stackoverflow.com/a/11920807 + return location.hash.match(new RegExp(key+'=([^&]*)'))[1]; +} + +function setValue(document_id, hash_key) { + document.getElementById(document_id).innerHTML = getHashValue(hash_key); +} + +function extractValues() { + setValue("access-token", "access_token"); +} |