Facebook javascript/ fbconnect ifuserconnected 导致问题
好吧,我正在这里阅读 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您看到的是现已弃用的旧 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).