2010-10-24 95 views

回答

0

它嵌入在iFrame中,所以從他們建議你實現它的方式來看,沒有它是不可能的。

但是如果你看看代碼:

http://www.facebook.com/plugins/likebox.php?href=http://www.facebook.com/platform&width=292&colorscheme=light&connections=10&stream=true&header=true&height=587

有可能是一種方式,如果你用它搗鼓呼籲如按鈕的另一個功能點擊調用一個Ajax功能,你確定你在你的網站上託管了所有的代碼,雖然FB可能已經放置了一些東西來實現這一點,或者如果這可能是違反了T & C,那麼值得一試。

1

我不知道如何獲取所有按下對象的按鈕的人,但您可以訂閱類似按鈕按下事件。然後,您可以使用有關當前用戶的信息,並將其保存到您自己的數據庫中。 您正在收聽的事件是edge.create,您可以使用FB自己的FB.Event.subscribe來做到這一點。 它可能看起來像這樣:

window.fbAsyncInit = function() { 
    FB.init({ 
     appId : 'xxxxxxxxxxxxxxxxxxxxxxxxx', 
     status : true, // check login status 
     cookie : true, // enable cookies to allow the server to access the session 
     xfbml : true // parse XFBML 
    }); 
    FB.Event.subscribe('edge.create', function(href, widget) { 
     FB.api('/me', function(response) { 
      alert(response.first_name + " " + response.last_name + ":" + response.id +" pressed " + href); // Replace this with an ajax call to your server 
     }); 
    }); 
};