2010-10-24 98 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 
     }); 
    }); 
};