简体   繁体   English

Facebook类似按钮拒绝在网站上显示

[英]Facebook Like Button Refusing To Show on Site

I have a simple question about the Facebook "like" button. 我有一个关于Facebook“喜欢”按钮的简单问题。 So I'm building a replica site of hulu.com , and so far it's been a breeze and I never thought that this would be such a hassle. 因此,我正在构建hulu.com的副本站点,到目前为止,这一直是一件轻而易举的事,而且我从未想到这将是一件如此麻烦的事。 I used the web developer tool provided by Facebook to generate the code, so it should be a simple copy and paste from there. 我使用了Facebook提供的Web开发人员工具来生成代码,因此它应该是从那里进行的简单复制和粘贴。 But, no matter how much i edit the source, or rearrange the code, NOTHING WORKS. 但是,无论我编辑源代码或重新排列代码量,都不起作用。 Please take a look and see what you can come up with as being the culprit to my problems. 请看一下,看看导致我问题的根源是什么。

PS : I've tried it on an entirely new HTML document as well, and still nothing is displayed onto the screen. PS:我也尝试过在全新的HTML文档中进行操作,但屏幕上仍然没有任何显示。

   <script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '436365349856529',
      xfbml      : true,
      version    : 'v2.2'
    });
  };

  (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 = "https://connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>

    <div class = "pull-right">
        <p> See what we're watching </p>
       </div>
      <div
  class="fb-like"
  data-share="true"
  data-width="450"
  data-show-faces="true">
</div>

Try on a real server and remove "https": 尝试在真实服务器上删除“ https”:

js.src = "//connect.facebook.net/en_US/sdk.js";

The code looks fine, so i assume you are trying to test it on your PC without any server. 该代码看起来不错,所以我认为您正在尝试在没有任何服务器的PC上对其进行测试。 Always use a server, you can also start one on your PC (localhost) - or just upload it to a real one. 始终使用一台服务器,您也可以在PC(本地主机)上启动一台服务器-或仅将其上传到真实服务器上。

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

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