English 中文(简体)
FB.event.subscribe(comment.create)不起作用
原标题:FB.event.subscribe( comment.create ) doesn t work
  • 时间:2011-05-27 01:31:25
  •  标签:
  • facebook

当用户使用社交插件进行评论时,我正在尝试获得通知。代码如下:

<fb:comments href= someurl  width= 400 ></fb:comments>
FB.Event.subscribe( comment.create , function(response)
{
 alert(response);
}

很简单,但不起作用。有人可能犯了错误?从我在网上的研究来看,通知似乎没有真正的一致性。有时有效,有时无效。

最佳回答

notice=“true”属性添加到fb:comments标记中。

<fb:comments notify="true" href= someurl  width= 400 ></fb:comments>
FB.Event.subscribe( comment.create , function(response)
{
 alert(response);
}
问题回答

为什么不关闭函数调用?

FB.Event.subscribe( comment.create , function(response)
{
  alert(response);
});

我也有同样的问题,直到我在这里偶然发现了这个答案:

通过FB.Event.subscribe订阅到comment.create或comment.remove的方法不会被触发

You should put everything related to FB.[...] functions (FB.init, FB.Event.suscribe, ...) in

window.fbAsyncInit = function(){ // Your code });

Otherwise your code will be parsed before the FB js sdk has been fully loaded and you will >never really suscribe to your event

这对很多人来说可能是显而易见的,但对我和其他新手来说,这可能会让你绊倒。





相关问题
Facebook Connect login dialog not working

I am using Facebook Connect for iPhone and following the official instructions. I use the following code to display the login dialog: FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:...

Facebook App Profile Tab is Empty ... No Content Displayed?

I can view my application via the http://apps.facebook.com/myapplication/ link and the content shows up correctly. I also added the application as a tab to a facebook page. However, when viewing the ...

Facebook Platform error: "Object cannot be liked"

I m working on a Facebook Application that generates wall posts. In testing these posts, I ve discovered that the Facebook Platform action of "liking" a post is failing. The specific error message ...

how to call showPermissionsDialog() in php (facebook api)?

I was reading over the documentation yet I could not figure out how to call Facebook.showPermissionsDialog() in php include_once ./facebook-platform/php/facebook.php ; $facebook = new Facebook(my ...

Facebook connect

If I plug in the facebook connect into my website, How can I prevent double signups? Lets say I have a user that s already signed up to my site but he clicked the connect with facebook, is there a ...

热门标签