你可以:
1) 自己通过 facebook 图表收集喜欢的数量,将它们保存在数据库中,然后在没有 FB 的情况下自行显示。
例如:http://graph.facebook.com/http://www.huffingtonpost.com/
或者更好:http://graph.facebook.com/http%3A%2F%2Fwww.huffingtonpost.com%2F
返回:
{
"id": "141265189223470",
"name": "The Huffington Post - Breaking News and Opinion",
"picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/188056_141265189223470_1131566_s.jpg",
"link": "http://www.huffingtonpost.com/",
"category": "Personal blog",
"likes": 15,
"website": "http://www.huffingtonpost.com/",
"description": "Breaking News and Opinion"
}
因此“喜欢”:15,
对于某些资源,您将需要一个访问令牌并在必要时对您的 url 进行 url 编码,因为这可能会导致复杂 url 出现问题。
2) 在 iframe 版本中显示点赞按钮,并在顶部放置另一个 div,以便用户无法与之交互,但我不建议这样做,因为当用户尝试点赞时,它可能会让您的用户感到沮丧。 (用户已经习惯了可以点击这个)
我想第三种选择是在每次显示页面时在客户端上使用图形 api 获取点赞数