Answer the question
In order to leave comments, you need to log in
How to insert into HTML the resulting string from the address bar?
I get a token in the address bar after authorizing the application, how can I add the token code to the HTML page with which I made the request? I'm a beginner, and I couldn't deal with the redirect. I get a token only with a non-existent URL (localhost).
request token:
https://instagram.com/oauth/authorize/?client_id=64c696ae6b32405a8efcd83889c571be&redirect_uri=http://localhost&response_type=token
localhost/#access_token=38780608.64c696a.48dffb12745e4103994e71fd895c355e
Answer the question
In order to leave comments, you need to log in
You can select the desired part of the address after the pound sign (#) like this:
var hash = window.location.hash;
if (hash.length > 1)
{
alert('Маркер доступа: ' + hash.substring(hash.indexOf('=') + 1));
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question