简体   繁体   English

Facebook不会出现Box之类的东西(引导程序)

[英]Facebook Like Box Won't Appear (Bootstrap)

So this has been driving me crazy, I've been searching similar questions but they all have solutions that seem not to work for me. 因此,这使我发疯,我一直在寻找类似的问题,但是它们都提供了对我似乎不起作用的解决方案。 I am trying to add a like box to my bootstrap website, but it won't appear. 我正在尝试在我的引导网站上添加一个类似的框,但不会出现。 I am using the HTML5 version of the widget but have tried others to no avail, have this after my body tag: 我使用的是HTML5版本的小部件,但尝试了其他方法后无济于事,请在我的body标签后加上:

    <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "js/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>

I made a local verison of all.js since GET was failing to retrieve it from the Facebook servers, even after I uninstalled Ghostery. 我做了all.js的本地版本,因为即使我卸载了Ghostery,GET仍无法从Facebook服务器中检索它。

Next, I added my like box using: 接下来,我使用以下方法添加了我的喜欢框:

<div class="fb-like-box" data-href="MYSITEURL" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="true"></div>

With my actual URL of course, and no go, no matter how I arrange the code in a div by itself or anything. 当然,有了我的实际URL,无论我是如何将代码本身或以任何方式排列在div中,都绝不行。 Any help is greatly appreciated! 任何帮助是极大的赞赏!

I'm assuming that you're testing the site on a local server, so all you need to do is add "https:" to this line: 我假设您正在本地服务器上测试站点,因此您需要做的就是在此行中添加"https:"

js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";

Like this: 像这样:

js.src = "https://connect.facebook.net/en_US/all.js#xfbml=1";

Cheers! 干杯!

I don't think your problem is related to Bootstrap. 我认为您的问题与Bootstrap没有关系。 See http://bootply.com/94974 , this use the same code as you do and works well. 请参阅http://bootply.com/94974 ,它使用与您相同的代码,并且运行良好。

Note in your example code js.src = "js/all.js#xfbml=1"; 注意示例代码中的js.src = "js/all.js#xfbml=1"; refers to a local all.js where something like //connect.facebook.net/nl_NL/all.js will be needed. 指的是本地all.js,其中需要//connect.facebook.net/nl_NL/all.js东西。

It works without problem. 它没有问题。 Need to be sure the referred fanpage (data-href) is a valid one. 需要确保引用的扇页(data-href)是有效的。

It can be FB page permissions setup issue. 可能是FB页面权限设置问题。 If the page visibility is restricted for audience from specific location(s), then the likebox doesn't appear. 如果特定位置的访问者的页面可见性受到限制,则不会显示“喜欢”框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM