C
C
cantmakemyname2014-03-09 20:47:46
In contact with
cantmakemyname, 2014-03-09 20:47:46

Why is the vkontakte api method not executed if I'm not logged in?

Hello. I get the number of likes for my page like this:

VK.api("likes.getList", {type: "sitepage", owner_id: appId, page_url: siteUrl}, function (data) {
    //показать данные
});

If I am logged in to VKontakte, then the method calls the callback and transfers data there, but if I am not logged in, then it does not call the callback. Tell me, please, why is that so?
I can still get the data via JSONP:
$.getJSON('https://api.vk.com/method/likes.getList?type=sitepage&owner_id=appId&page_url=siteUrl&filter=likes&callback=?', function(data,status,xhr) {
    //показать данные
});

But I'm wondering why the method through Javascript does not work. Thanks in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question