S
S
slava kk2019-02-04 10:38:06
JavaScript
slava kk, 2019-02-04 10:38:06

How to parse this line?

httppps:///test22.ru/t#access_token=xxxxxxxxxxx&
expires_in=86400&user_id=xxxxxxx
How to parse this string to get the token individually? it's a hash string, it's not a get request!
(This is a token from VK)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Shvedkov, 2019-02-04
@kosolapus

On php - about nothing (the hash is not sent to the server with the request)
On JS + php:
we pull the hash through
Then we send it to the server in any convenient way.

V
vjachet, 2019-02-04
@vjachet

var token = document.location.hash.match(/access_token=([^&]+)/)[1];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question