4

我正在尝试集成 Facebook 的“赞”按钮,其中“赞”操作与回调函数集成。它似乎正在工作,除了“喜欢”活动没有出现在 Facebook 上。

我正在使用自己的 Facebook 帐户对此进行测试,但在我的提要、个人资料页面或活动日志中看不到该活动。

这是我的网址: http: //flevy.com/powerpoint-plugin-test

这是我的代码:



    <script src=\"http://connect.facebook.net/en_US/all.js\" type=\"text/javascript\"></script>
    <script>
      window.fbAsyncInit = function() {
        // init the FB JS SDK
        FB.init({
          appId      : 'xxxxxx', // App ID from the App Dashboard
          status     : true, // check the login status upon init?
          cookie     : true, // set sessions cookies to allow your server to access the session?
          xfbml      : true  // parse XFBML tags on this page?
        });
        FB.Canvas.setAutoResize();
      };
    </script>


    <div class=\"fb-like\" data-href=\"$share_url\" data-send=\"false\" data-layout=\"box_count\" data-width=\"50\" data-show-faces=\"false\"></div>


    // facebook callback
    FB.Event.subscribe('edge.create', function(href, widget) {
        deliverEmail();
    });

4

3 回答 3

5

我将首先修复 Open Graph 调试器上的错误:

https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fflevy.com%2Fpowerpoint-plugin-test

必须修复的错误

Object Invalid Value
Object at URL 'http://flevy.com/powerpoint-plugin-test' of type 'website' is invalid because the given value '//flevy.com/images/slides.gif' for property 'og:image:url' could not be parsed as type 'url'.
于 2013-02-21T06:45:38.710 回答
2

你的 javascript 抛出一个错误说:

未捕获的类型错误:对象 # 没有方法“setAutoResize”

AFAIK,现在不推荐使用 setAutoResize 函数。参考https://developers.facebook.com/roadmap/completed-changes/#september-2012

而且,据我了解,即使是替换 this 的功能,也应该在您在 Facebook Canvas 中加载 this 时使用。

所以,请检查你在这里做什么!:)

于 2013-02-26T18:19:14.943 回答
0

这个页面有很多 HTML 语法不一致/验证问题。您可以在 HTML 中为属性值切换单引号、双引号和无引号。该代码还缺少一些终止标签。这可能会导致一些不稳定的行为。你的 JavaScript 有同样的问题,你在同一个脚本块中使用单,然后双......虽然这看起来确实有效。

您可以在此处运行验证:

http://validator.w3.org/check?uri=http%3A%2F%2Fflevy.com%2Fpowerpoint-plugin-test&charset=%28detect+automatically%29&doctype=Inline&group=0

@DrBeza 所说的开放图验证也应该得到解决。不知道为什么框架不喜欢非协议特定的 URL,而只是将 http:// 或 https:// 添加到该图像。

清理之后,这应该更容易排除故障,或者问题可能是需要清理的结果。

于 2013-02-27T20:47:22.640 回答