-1

我的页面上有两个Facebook 插件(喜欢和评论框)。当我使用插件登录时,它不会自动登录另一个插件,直到我刷新页面。

例如:当我通过点击喜欢按钮登录时,我的评论框保持注销状态,直到我刷新页面。

请给我建议一些对这个问题有好处的东西

我的代码如下

<script>
    window.fbAsyncInit = function () {



FB.init({ appId: 'My app ID', status: true, cookie: true, xfbml: true });


        FB.Event.subscribe("xfbml.render", function (targetUrl) {
            $("#myh1").html("Facebook Loaded");
            //alert('edge.create');
            setTimeout(aaa, 500);



        });

        FB.Canvas.setDoneLoading(function () {
            alert("Done loading");
        });



        FB.Event.subscribe('comment.remove', function (response) {
            alert('The status of the session is: ' + response.status);
        });
    };
    (function () {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol +
  '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root').appendChild(e);
    } ());


    function aaa() {

        $("#content_1").mCustomScrollbar({
            scrollButtons: {
                enable: false
            }
        });
    }

</script>


<div class="fb-like" data-send="false"  data-href="http://www.facebook.com    /AiLiveCaptions"   data-width="298" data-show-faces="true">
        </div>

<div class="fb-comments" data-href="http://www.facebook.com/AiLiveCaptions" data-num-    posts="8" order_by="reverse_time" data-width="280"></div>
4

1 回答 1

0

您可以使用

FB.XFBML.parse();

动态呈现文档中的 XFBML 标记。

FB 文档

于 2012-09-01T09:18:04.263 回答