2011-12-29 77 views
0

IM使用likebox在iframe中likebox事件(IFRAME)

<iframe src="//www.facebook.com/plugins/likebox.php?href= 
    <?=Facebook::GetConfig('LikeUrl')?> 
&amp;width=292&amp;height=290&amp;colorscheme=light&amp; 
show_faces=true&amp;border_color&amp;stream=false&amp; 
header=true&amp; 
appId=<?=Facebook::GetConfig('appId')?>" 
scrolling="no" frameborder="0" style="border:none; overflow:hidden; 
width:292px; height:290px;" allowTransparency="true" id="fbframe"></iframe> 

我怎麼能知道有用戶按下喜歡按鈕或沒有辯論,因爲

FB.Event.subscribe('edge.create', function(targetUrl) { 
    alert('liked '); 
    }); 

不工作

回答

3

edge.createedge.remove僅針對非Iframe版本的Like Button(XFBML和HTML5)觸發事件

您可以輕鬆地更改您的Iframe版本其他:

<fb:like-box href="<?=Facebook::GetConfig('LikeUrl')?>" width="292" height="290" 
      show_faces="true" stream="false" header="true"></fb:like-box>