Get param value after hash in URL in vanilla JS

Sean Thompson

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.

Sushanth --

Just split with '=' on the returned key value pair

var token = obj.split('=')[1] ;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Angular js - get url query params when url has # hash

From Dev

express.js can not get url's hash segment directly?

From Dev

Yii - GET param in URL path

From Dev

Hide param value (guid) in an URL

From Dev

Perl get value of nested hash

From Dev

Get a value from a reference to a hash

From Dev

Get all images in a div using vanilla JS

From Dev

Get value from hash of hashes

From Dev

Is there a way to get the original value back after this hash function?

From Dev

express.js can not get url's hash segment directly?

From Dev

jQuery - Get url hash

From Dev

get value after certain character in URL bar

From Dev

regex on url cannot split out hash without GET param

From Dev

Regex for add GET param to URL

From Dev

Perl get value of nested hash

From Dev

url rewrite and get param is not working

From Dev

Get records by hash value

From Dev

find out the previous URL and the value after hash # in Laravel

From Dev

Logstash : get URL params into hash

From Dev

how to get hash value from the URL

From Dev

How to get a url as a param in Node.js?

From Dev

Get value of paper-listbox from vanilla JS

From Dev

Dropbox api V2, get access token in query param instead of url hash (#) (Nodejs)

From Dev

How To Get Total Value Of Inputs With Vanilla Javascript?

From Dev

Get value from Ruby hash

From Dev

Get ID of clicked element Vanilla JS

From Dev

How to get the position of an element after css animation (vanilla js)

From Dev

vanilla js, get anchors with certain attribute

From Dev

Is a url a valid value for a query param?