Facebook “like” button which likes another page/URL

[亡魂溺海] 提交于 2019-12-05 18:31:35

You can use the iframe version of the Like Button, rather than FBML. The iframe requires that you pass the url as part of the query string.

You can generate the iframe code here.

Try the following:

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

Where the href attribute is the URL you want the person to 'like'

<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>

Just replace the [put the url here] with the url you want to like and then paste the full code to the place where you want the like button.

You can always just go to the Facebook Developers page here:

http://developers.facebook.com/docs/reference/plugins/like/

and it will generate the code for you, and you can just copy it into your site. I just re-verified it. It works nicely.

This will generate the code(or something similar) that @Coding-Freak wrote.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!