Facebook分享/评论不能像他们应该的那样工作 [英] Facebook share/comments don't work like they should

查看:72
本文介绍了Facebook分享/评论不能像他们应该的那样工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的页面中,我添加了Facebook评论以及分享按钮。一切都按照他们的指示完成,所以:

In my page I've added Facebook Comments as well as Share button. Everything was done according to their instruction, so :

我已经加载了脚本:

<div id="fb-root"></div>
<script type="text/javascript">
    window.fbAsyncInit = function() {
    FB.init({appId: '161771113844567', status: true, cookie: true, xfbml: true});
    };
    (function() {
    var e = document.createElement('script');
    e.type = 'text/javascript';
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    e.async = true;
    document.getElementById('fb-root').appendChild(e);
    }());
</script>

然后在使用评论/分享的页面上:

and then on pages that use comments/share:

    <div class="facebook-comments">
        <fb:comments xid="{{star.uniq.id}}" url="" title="Test"></fb:comments>
    </div>

和:

    <a name="fb_share" type="box_count" share_url="url" 
    href="http://www.facebook.com/sharer.php">
        Share
    </a>
    <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

但评论仅会不时加载(否则为 FB。提供不是函数错误显示)并且共享按钮始终显示0。有没有办法来解决这个问题 ?我已经尝试下载all.js,但随后注释未加载的任何内容。

but the comments are loaded only from time to time (otherwise a FB.provide is not a function error is shown) and share button shows 0 all the time. Is there a way to fix this ? I've tried downloading all.js but then comments where not loaded at all.

推荐答案

您正在使用旧的javascript SDK和新的。不再推荐使用facebook sharer.php,而是替换为like按钮。解决方案是删除Facebook Share并将其替换为类似按钮。这样您只会使用新的Javascript SDK http://connect.facebook.net/en_US/ all.js 。您不能同时使用这两者。 static.ak.fbcdn.net/connect.php/js/是旧SDK,不推荐使用。

You are using both the old javascript SDK and the new one. The facebook sharer.php is no longer recommended an is being replaced by the like button. The solution is to remove the Facebook Share and replace it with a like button. This way you will only be using the new Javascript SDK http://connect.facebook.net/en_US/all.js. You cannot use both of these at the same time. static.ak.fbcdn.net/connect.php/js/ is the old SDK and is being deprecated.

这篇关于Facebook分享/评论不能像他们应该的那样工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆