Facebook new Like Box (Page plugin) not working

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 11:25:14

问题


Hello I am trying to add a facebook plugin to my page but it doesn't appear. I try it for different pages but it doesn't working for no one. One example is the above

I put these code just right after the opening <body> tag:

<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/el_GR/sdk.js#xfbml=1&version=v2.5&appId=1712213445680154"; fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script>`

And then I place the code for my plugin wherever want it to appear on my page but I see just nothing? What's happening?

<div class="fb-page" data-href="https://www.facebook.com/sportdog" data- height="340" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-show-posts="true"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/sportdog"><a href="https://www.facebook.com/sportdog">SportDog.gr</a></blockquote></div></div>


回答1:


My answer is late, but its worthful, I faced same issue after researching it many hours I made it work in following way. Give it try and It works for you. You can customize options of iframe i.e width, show_facepile, small_header etc
List of all customisable options can be found there.

<!DOCTYPE html>
<html>
  <head>
    <title>Page Title</title>
  </head>
  <body>
    <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId      : '1614814185438138',
          xfbml      : true,
          version    : 'v2.5'
        });
      };

      (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>
    <iframe name="f11d8956d8" height="1000px" frameborder="0" allowtransparency="true" allowfullscreen="true" scrolling="no"
    title="fb:page Facebook Social Plugin" src="http://www.facebook.com/v2.5/plugins/page.php?adapt_container_width=true&amp;app_id=1614814185438138&amp;channel=http%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D42%23cb%3Df43cf5f68%26domain%3Dwww.facebook.com%26origin%3Dhttp%253A%252F%252Fwww.facebook.com%252Ff245f287b8%26relation%3Dparent.parent&amp;container_width=200&amp;hide_cover=false&amp;href=https%3A%2F%2Fwww.facebook.com%2FAndresIniesta&amp;locale=en_GB&amp;sdk=joey&amp;show_facepile=true&amp;small_header=true&amp;tabs=timeline"
    class="" style="border: none; visibility: visible;">
    </iframe>
  </body>
</html>


来源:https://stackoverflow.com/questions/33710826/facebook-new-like-box-page-plugin-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!