A
A
arti_djeims2015-10-02 13:51:49
JavaScript
arti_djeims, 2015-10-02 13:51:49

How to display a person's name during authorization through VK on js?

I connected this widget https://vk.com/dev/Auth
after clicking it redirects to the page where
?uid=id of the person&first_name=name
is added to the domain so that's how to display the person's name and id (first_name and uid) on the page using js
What would write your id: and here uid (from the address)
Your name is: and name (from the address)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivanq, 2015-10-02
@arti_djeims

function $_GET(key) {
    var s = window.location.search;
    s = s.match(new RegExp(key + '=([^&=]+)'));
    return s ? s[1] : false;
}
alert($_GET("uid") + ", " + %_GET("first_name"));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question