Search code examples
javascriptfacebookfacebook-social-plugins

Facebook async with no facebook buttons


I made a Facebook async implementation where you can like different items of the page.

You can see my implementation in this jsFiddle.

Code:

window.fbAsyncInit = function () {
    FB.init({ status: true, cookie: true, xfbml: true });
};
(function () {
    var e = document.createElement("script"); e.async = true;
    e.src = document.location.protocol + "//connect.facebook.net/nl_NL/all.js";
    document.getElementById("fb-root").appendChild(e);
} ());

Now I have three Facebook like buttons. But my problem is, I want it so that you can click on the a href links. When you click on the first like this <a> element. Than you like the first message / bericht.

How can I make that?


Solution

  • It is only possible to like a post (On Facebook) using the provided Graph API and FQL, not a page on the Open Graph.

    I'm afraid that you have to use the implementations that Facebook provide.

    Please see this post: 'Like' a page using Facebook Graph API