Facebook:用户喜欢/成为页面的粉丝

时间:2010-06-17 16:33:06

标签: facebook opengraph

在任何facebook api(连接,图形,休息等)中都有一种方法可以提示用户成为页面的粉丝(现在称为喜欢页面)。

3 个答案:

答案 0 :(得分:1)

<iframe frameborder="0" scrolling="no" allowtransparency="true" style="border: medium none; overflow: hidden; width: 150px; height: 20px;" src=" http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.yoursiteurlencodedhere.com&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=dark&amp;height=80"></iframe>

请注意: http%3A%2F%2Fwww.yoursiteurlencodedhere.com 部分。

答案 1 :(得分:0)

通过Facebook API无法实现。以上iframe解决方案可能有效。

答案 2 :(得分:0)

以下是添加Facebook按钮的详细信息。

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

您可以使用iframe方法:

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>

或者您可以使用xfbml方法:

<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like show_faces="true" width="450"></fb:like>

我个人认为xfbml方法更清晰。不幸的是,这并没有主动提示用户,它只是将按钮添加到您的页面。他们的api无法提示某人。