5

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

4

3 回答 3

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部分。

于 2010-11-27T15:29:29.210 回答
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 中没有办法提示某人。

于 2011-02-14T02:32:24.113 回答
0

这是不可能通过 Facebook API 实现的。以上 iframe 解决方案可能有效。

于 2011-01-19T10:04:45.557 回答