C
C
CoDe_reD2012-05-01 20:14:05
JavaScript
CoDe_reD, 2012-05-01 20:14:05

How to process the callback of the "Like" button on the Vkontakte website?

There is a situation: there are several “Like” buttons on the page and you need to perform some action if the user clicked on it, but the standard callback from the Vkontakte API returns only the number of votes, I don’t know why it’s done this way and there seems to be no way to reach the developers.
Please tell me how to process this event in another way.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
X
XimikS, 2012-05-01
@XimikS

what kind of button do you have? here the generated code is different for each: somewhere it’s just an iframe, somewhere a rather big table with id = “vk_like”, well, you can hang it elementary on what was generated through JQuery

.on('click', function() 
{ 
  //код
}

Or I didn't understand your question

X
XimikS, 2012-05-01
@XimikS

understood, and yes, there are frames everywhere, overlooked.
Do you need to perform a separate action for each button?

N
Nikolai Vasilchuk, 2012-05-01
@Anonym

Do not process at all. This is done so that the user by clicking on the well-known and understandable “Like” does not subscribe to the mailing list about organ augmentation.

H
HeadFore, 2012-05-01
@HeadFore

In this case, the solution is to pull vk.com/developers.php?oid=-1&p=likes.getList with different item_id only by timeout. Fortunately, access_token is not needed.

T
traneblow, 2012-05-02
@traneblow

Guys, the easiest way is to unsubscribe to Support .

R
Riateche, 2012-05-02
@Riateche

Put each button in a separate iframe that contains nothing but that button. When a callback arrives, we look at the name of the frame in which it came and call the function that lies in the parent frame, passing it the name of the frame.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question