2011-11-02 68 views
0

我们在Facebook中使用Iframe Type应用程序。从Iframe重新加载页面Like Button Plugin

最近我们在Iframe Canvas页面(渲染页面)中使用了下面的Like Button代码。

<iframe id="theiframe" src="http://www.facebook.com/plugins/like.php?href=http%3a%2f%2fwww.facebook.com%2fpages%2fRp9%2f151605171570927%3fsk%3dapp_196290923727494&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:330px; height:26px; padding-top:5px; padding-left:5px;" allowTransparency="true"></iframe> 

当用户点击“喜欢”我们要重新加载页面的“喜欢”的内容。

但是,当我们使用代码时,我们没有得到Like Button的任何事件。

在下面的链接http://developers.facebook.com/docs/reference/plugins/like/给出的细节跟踪像按钮事件。但是,这是与xFBML应用程序。

我们正在使用Iframe应用程序。关于Iframe选项,上面的链接没有任何细节。

任何人都可以帮助我们解决这个问题吗?

由于提前,

阿希什舒克拉

回答

0

您可以使用JavaScript来听,当有人点击一个按钮一样触发事件edge.create。

FB.Event.subscribe文档https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

我认为它无法与iframe按钮的工作,如果在XFBML创建类似按钮或HTML5像下面这只会工作:

<div class="fb-like" data-send="true" data-width="450" data-show-faces="true"></div>