Facebook javascript/ fbconnect ifuserconnected 导致问题

发布于 2024-09-11 08:12:33 字数 645 浏览 7 评论 0原文

好吧,我正在这里阅读 fb 连接教程

http://wiki.developers.facebook。 com/index.php/Facebook_Connect_Tutorial1

我遇到的问题是在教程接近尾声时,它说这样做,

<script type="text/javascript">  FB.init("apikey","xd_receiver.htm", {"ifUserConnected" : update_fbuser}); </script> 

而不是

<script type="text/javascript">  FB.init("apikey","xd_receiver.htm"); </script> 

现在我的问题是,当我使用第一个时,登录到 facebook 按钮我已经停止显示,有人注意到第一个有什么问题吗,第二个工作正常(只是不使用 ifuserconnected)

谢谢:)

well I'm reading the fb connect tutorial here

http://wiki.developers.facebook.com/index.php/Facebook_Connect_Tutorial1

The problem I'm having is near the end of the tutorial, it's saying do do this

<script type="text/javascript">  FB.init("apikey","xd_receiver.htm", {"ifUserConnected" : update_fbuser}); </script> 

as oppose to

<script type="text/javascript">  FB.init("apikey","xd_receiver.htm"); </script> 

Now my problem is, when i use the first one, the login to facebook button I have stops showing, does anyone notice anything wrong with the first one, the second one works fine (just doesnt use the ifuserconnected)

Thanks :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝海 2024-09-18 08:13:44

首先,您看到的是现已弃用的旧 API。如果您刚刚开始,最好从当前的开始。您可以在此处阅读相关内容。

至于你的代码。您需要声明回调函数update_fbuser(),当用户登录状态发生变化时将调用该函数。您可能没有它,所以它会损坏。您可以在此处找到更多示例(但这些示例同样来自旧 API,现在事情完全不同)。

First of all you are looking at the old API now deprecated. If you are just starting you better start with the current one. You can read about it here.

As to your code. You need to declare callback function update_fbuser() that will be called when a user login status changes. You probably don't have it so it breaks. You can find more examples here (but again those are from old API, now things are completely different).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文