Created
December 10, 2013 00:41
-
-
Save jdaily/7883835 to your computer and use it in GitHub Desktop.
Sample Javascript Parsing of oAuth Implicit Response
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
// Parse the query string | |
var params = {}, queryString = location.hash.substring(1), | |
regex = /([^&=]+)=([^&]*)/g, m; | |
while (m = regex.exec(queryString)) { | |
params[decodeURIComponent(m[1])] = decodeURIComponent(m[2]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment