jquery - Facebook 的“赞”按钮显示所有 Facebook 页面的赞数为 0

标签 jquery facebook facebook-graph-api facebook-like

更新:所以这很大。如果您尝试使用点赞按钮链接到任何 Facebook 页面,那将不起作用。尝试转到 Facebook 点赞创建页面 (http://developers.facebook.com/docs/reference/plugins/like/) 并输入任何 facebook 点赞页面的 URL(例如 Stackoverflow 的:http://www.facebook.com/stackoverflowpage)。

此代码在今天早些时候之前运行良好,现在我完全不知道为什么它停止工作了。点赞按钮加载,但您无法点赞或发送消息,点赞计数为 0(应该在 350 左右)。

这是 jsfiddle。很简单:http://jsfiddle.net/rqR6C/

我经常且仅在 Google Chrome 的控制台中收到错误消息。我发现其他一些人也遇到了同样的错误消息,他们也说这是间歇性的。这是错误:

The frame requesting access set 'document.domain' to 'facebook.com', but the frame being accessed did not. Both must set 'document.domain' to the same value to allow access.

代码:

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
    // Init the SDK upon load
    window.fbAsyncInit = function() {
        FB.init({
        appId      : '464723870207650', // App ID
        channelUrl : '//'+window.location.hostname+'/channel.php', // Path to your Channel File
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        xfbml      : true,  // parse XFBML
        frictionlessRequests: true
        });
    }

    // Load the SDK Asynchronously
    (function(d){
        var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
        if (d.getElementById(id)) {return;}
        js = d.createElement('script'); js.id = id; js.async = true;
        js.src = "//connect.facebook.net/en_US/all.js";
        ref.parentNode.insertBefore(js, ref);
    }(document));
</script>
<div class="fb-like" data-href="http://facebook.com/pages/Grouptonescom/160798537354204" data-send="true" data-layout="button_count" data-width="180" data-show-faces="false"></div>​

最佳答案

更新:一位在 Facebook 工作的 friend 确认这是一个错误,现在它刚刚被修复。这是供后代使用的星巴克页面的屏幕截图:

Starbucks.com has 0 FB likes


零赞的原因是 fb:like href 设置为您的 Facebook 页面。这是一个错误,因为 Facebook docs for the plugin officially state :

Can I link the Like button to my Facebook page?

Yes. Simply specify the URL of your Facebook page in the href parameter of the button.

其他人在 SO - Adding your Facebook Fan Page URL to the LIKE button doesnt work anymore? 上注意到了这一点

Facebook 制作了一个recent announcement about Like migrations (2011 年 11 月 7 日),看起来他们在这个过程中破坏了一些东西。

我添加了一个 <meta property="fb:app_id" content="..." />行,从中提取应用程序 ID https://graph.facebook.com/ (虽然不确定这是否正确)。没有帮助。仍然无法指向我们的粉丝页面。

尝试向 Facebook 报告此问题是徒劳的。 Known Issues page似乎基本上被遗弃了,但是有一个联系表格 Facebook Business Pages在“告诉我们更多”下。我建议尽可能多的人使用该表格报告此问题。这是我的报告:

Since the Nov. 7 migration of the like plugin, linking the Like button to a Facebook page will show zero likes for that page. Examples include http://fundersandfounders.com/ (which links to https://www.facebook.com/fundersandfounders with 17,000 likes).

关于jquery - Facebook 的“赞”按钮显示所有 Facebook 页面的赞数为 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13372154/

相关文章:

android - 如何在 Android 中获取 facebook 好友的生日、电子邮件和个人资料图片

javascript - 在 json 数组中搜索特定属性

jquery - 如何让 jquery datepicker 处理克隆行?

JavaScript 多维数组

Facebook 开发者帐户,所有应用程序都消失了

java - Facebook 的 Spring Social - 获取用户位置

android - 使用 SDK 3.5 中的提要对话框在 friend 的墙上发帖

javascript - 需要在 Bootstrap 折叠目标卡中切换 bg-dark

Facebook Open Graph 多个对象发布

facebook - 多个 Facebook 应用程序作为 AWS Cognito 联合身份的身份提供商