Skip to content

Instantly share code, notes, and snippets.

@jdaily
Created December 10, 2013 00:41
Show Gist options
  • Save jdaily/7883835 to your computer and use it in GitHub Desktop.
Save jdaily/7883835 to your computer and use it in GitHub Desktop.
Sample Javascript Parsing of oAuth Implicit Response
// 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