2012-03-05 111 views
0

Like Button:(成功將用戶指向特定Facebook頁面) 示例: [http://lifelearning.x10.mx/FB-test2.html ] [1]Facebook Like Box不會將用戶重定向到Facebook頁面,因爲Facebook Like按鈕不會將Facebook用戶重定向到Facebook頁面

<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> 

喜歡盒:(不成功) 實施例: [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 Box的工作方式與Like Button相同。

*這些都是從網上收集的。代碼是我的。

回答

0

問題是edge.create事件沒有被Like Box激發,所以你將無法使它工作。我建議你你的聲音添加到下面的錯誤報告對這個問題:

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

+0

是的,我以前也讀了文章。看來我現在唯一能做的就是等待。儘管如此,自FB開發者上次更新以來已經很長時間了。 – 2012-03-07 01:50:41