Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook Connect API not populating user data when facebook-logo="true" option is used
    text
    copied!<p>I'm working on a Facebook Connect app. I have the Connect button up and running and users can successfully authenticate via Facebook. However, I'm having trouble getting their profile picture and name to display with XFBML. Here is what I'm doing:</p> <pre><code>&lt;script type="text/javascript"&gt; function fb_login_handler() { var userbox = document.getElementById( "fb_userbox" ); userbox.innerHTML = "&lt;span&gt;" + "&lt;fb:profile-pic uid=loggedinuser facebook-logo='true'&gt;&lt;/fb:profile-pic&gt;" + "Welcome, &lt;fb:name uid=loggedinuser useyou='false'&gt;&lt;/fb:name&gt;" + "&lt;/span&gt;"; FB.XFBML.Host.parseDomTree(); } &lt;/script&gt; ... &lt;div id="fb_userbox"&gt; &lt;fb:login-button onlogin="fb_login_handler();" autologoutlink="1" length="long"&gt;&lt;/fb:login-button&gt; &lt;/div&gt; ... &lt;!-- Facebook Connect initialization --&gt; &lt;script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; FB.init("[MY_API_KEY]", "/xd_receiver.htm", { "ifUserConnected" : fb_login_handler } ); &lt;/script&gt; </code></pre> <p></p> <p>I can successfully login with the Connect button, and the Javascript callback gets run, but I just end up with this:</p> <p><a href="http://www.friedo.com/fbuserbox.png" rel="nofollow noreferrer">http://www.friedo.com/fbuserbox.png</a></p> <p>So neither the picture nor the name is getting populated. The same thing happens even if I hardcode my FB profile ID in place of <code>loggedinuser</code>. </p> <p><b>Update:</b> It seems (after randomly messing around) that I can get it to work if I turn off the <code>facebook-logo</code> attribute from the <code>fb:profile-pic</code> tag. Setting it to false (or removing it) causes the user box to render correctly. But I need to Facebook logo to work, too. :(</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload