Get param value after hash in URL in vanilla JS

Viewed 4444

I know this is probably extremely simple, but I can't seem to figure it out or find the answer I'm looking for. I'm using Instagram's API to allow user's to login and see their feed. This is done on the client side with Javascript. After authorizing my app, the browser sends back an access token in the url like so: www.example.com/#access_token=12345679.

What's the simpest vanilla JS to get the raw number of the access token? I've tried location.hash but that returns both the key and value like so: acess_token=123456789

Any help appreciated.

2 Answers
Related