Facebook javascript/ fbconnect ifuserconnected causing problems
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开发者_StackOverflow :)
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).
精彩评论