Facebook Like Box不会像Facebook Like按钮那样将用户重定向到Facebook页面

时间:2012-03-05 16:02:59

标签: javascript facebook facebook-like facebook-likebox

Like Button :(成功将uesrs指向特定的Facebook页面) 例: [http://lifelearning.x10.mx/FB-test2.html] [1]

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head></head>
<body>
<div id="fb-root"></div>

<fb:like href="http://www.facebook.com/pages/AEA-%E6%BE%B3%E6%B4%B2%E6%95%99%E8%82%B2%E5%8D%94%E6%9C%83/372744124562?bookmark_t=page" send="false" width="450" show_faces="false" font=""></fb:like>

<script type="text/javascript">
    window.fbAsyncInit = function() {
        FB.init({appId: '372744124562', status: true, cookie: true, xfbml: true});
        FB.Canvas.setSize({ width: 520, height: 1500 });
        FB.Event.subscribe('edge.create',
            function(response) {
                // put redirect code here eg
                window.location = "http://www.facebook.com/pages/AEA-%E6%BE%B3%E6%B4%B2%E6%95%99%E8%82%B2%E5%8D%94%E6%9C%83/372744124562?bookmark_t=page"; 
            }
        );
    };

    //Load the SDK asynchronously
    (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);
    }());
</script>
</body>
</html>

喜欢Box :(不成功) 例: [http://lifelearning.x10.mx/FB-test3.html] [2]

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head></head>
<body>
<div id="fb-root"></div>

<fb:like-box href="http://www.facebook.com/pages/AEA-%E6%BE%B3%E6%B4%B2%E6%95%99%E8%82%B2%E5%8D%94%E6%9C%83/372744124562?bookmark_t=page" width="292" show_faces="true" stream="true" header="true"></fb:like-box>


<script type="text/javascript">
    window.fbAsyncInit = function() {
        FB.init({appId: '372744124562', status: true, cookie: true, xfbml: true});
        FB.Canvas.setSize({ width: 520, height: 1500 });
        FB.Event.subscribe('edge.create',
            function(response) {
                // put redirect code here eg
                window.location = "http://www.facebook.com/pages/AEA-%E6%BE%B3%E6%B4%B2%E6%95%99%E8%82%B2%E5%8D%94%E6%9C%83/372744124562?bookmark_t=page"; 
            }
        );


 };

    //Load the SDK asynchronously
    (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);
    }());
</script>
</body>
</html>

人们说这是Like Box上的一个错误。有些人证明它确实有效: http://www.fbrell.com/xfbml/fb%3alike-box

任何了解Facebook的人都可以帮忙吗?我很了解JS,但对Facebook的API一无所知。任何人都可以像Like Button一样讲述如何使Like Box工作。

* 这些都是从网上收集的。代码是我的。

1 个答案:

答案 0 :(得分:0)

问题是,Like Box不会触发edge.create事件,因此您将无法使其工作。我建议您将您的声音添加到以下有关此问题的错误报告中:

https://developers.facebook.com/bugs/310763168934515