Facebook Like Button That Likes Another Page / URL

I have a list of links, and on every single page there is a “like” button to “like” that page. But I want a “like” button next to each link in the list that will like the URL of the link next to it (just like if you clicked on the link and then the “like” button).

How should I do it?

To create a button on each individual page, I use the following code:

<script>
window.fbAsyncInit = function()
{
     FB.init({appId: '*****', status: true, cookie: true, xfbml: true});
};
</script>

<div class="share_button btn_fb">
<fb:like layout="button_count" font="tahoma"></fb:like>
</div>
+3
source share
4 answers

You can use the iframe version of the Like button, not FBML. The iframe requires you to pass the URL as part of the query string.

iframe- .

+6

:

<fb:like layout="button_count" href="http://yourlink.com" font="tahoma"></fb:like>

href URL-, , ""

+5
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="[put the url here]" send="true" width="450" show_faces="true" font=""></fb:like>

[put the url here] URL, , .

+1
+1

All Articles