简体   繁体   English

Facebook流不会出现在网站上

[英]Facebook stream won't appear on website

I've read the previous problems for other people in this situation but none of them rectify my issue. 在这种情况下,我已经为其他人阅读了以前的问题,但是没有一个人可以纠正我的问题。

Nothing shows up at all on my website when trying to implement this facebook like/stream to a website.. any ideas? 尝试将此类Facebook类/流实现到网站时,我的网站上什么都没有显示。

<html>
<head>
<title><hi></title></head>
<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 = "https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>






<div class="fb-like-box" data-href="https://www.facebook.com/Aberliquidscreed" data-width="250px" data-height="400px" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="true"></div>
</body>
</htm>

Your missing your facebook SDK and facebook API call FB.init 您错过了Facebook SDK和Facebook API调用FB.init

Step one: (put this inside your header html tag and update the appid_goes_here with your id) 第一步:(将其放入您的标头html标签中,并使用您的ID更新appid_goes_here)

   <script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'APPID_goes_here',
      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 = "//connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>

Step Two: (anywhere in content replace appid_goes_here with your api key) 第二步:(在内容中的任何位置,用您的api密钥替换appid_goes_here)

 <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 = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=appid_goes_here&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

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

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