Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Does their API not allow you to do this? Google, what else can you say and look at their api, maybe there is a status checker
The users.get method returns user information, including 'online'. You can read about the field online here
So be it, I'll give you a gift, I'll write the code for you, lol:
First you need to include jquery in the head
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
var placeHolder = $('#test'); //Id элемента куда будем выводить результат
var url='https://api.vk.com/method/users.get?user_ids=ТУТIDчеловека&fields=online&v=5.45';
var answer;
$.ajax
({
url: url,
type: 'get',
crossDomain: true,
dataType: 'jsonp',
success: function(response)
{
answer = response;
answer.response.forEach(function(item)
{
if(item.online === 1)
{
alert('Пользователь Online!');
} else {
alert('Пользователь не Online!');
}
});
},
error: function(error)
{
console.log('Ошибка');
console.log(error);
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question