开发者

Comment box not appearing in XFBML Like button linked to Facebook page

开发者 https://www.devze.com 2023-04-06 21:45 出处:网络
On my website I have an XFBML Like button linked to a Facebook page. I set up the app with t开发者_开发技巧he website\'s domain as the App Domain and included the Javascript SDK with the app id.

On my website I have an XFBML Like button linked to a Facebook page. I set up the app with t开发者_开发技巧he website's domain as the App Domain and included the Javascript SDK with the app id.

The Like button itself works, but the comment section does not appear. Inspecting the page in Chrome shows that an iframe appears beneath the like button, but it contains only a script tag with some code. What am I doing wrong here?


You are loading the javascript sdk with this code:

  (function(d){
     var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     d.getElementsByTagName('head')[0].appendChild(js);
   }(document));

It is looking for a div with an id of facebook-jssdk, but this div doesn't exist. Try adding this somewhere in your page:

<div id="facebook-jssdk"></div>


Take a look at this known Facebook bug: http://developers.facebook.com/bugs/293075054049400

Basically, one gets this behavior if secure browsing is enabled on the Facebook user's account.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号