Facebook page plugin not showing on website

I was trying to embed a facebook fan page element to my site. I went HERE to get the code working correctly. As a result, I copied and pasted this:

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

      

Right after the body tag (as I was told to do) and this:

     <div id="facebookPage">
     <div class="fb-page" data-href="https://www.facebook.com/StonedMeadowOfDoom?fref=ts"
 data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="false"
     data-show-posts="false"><div class="fb-xfbml-parse-ignore">
    <blockquote cite="https://www.facebook.com/StonedMeadowOfDoom?fref=ts">
    <a href="https://www.facebook.com/StonedMeadowOfDoom?fref=ts">
    Stoned Meadow Of Doom</a></blockquote></div></div>

      

In the footer where I need a box. It was inside a div, but later the test turned out to be the same as in all other places.

The problem is that when I wanted to test this thing, it didn't display as expected. The only thing I got was the underlined text "Stoned Meadow of Doom" with a link to the fan page. No box, no, nothing.

So my question is, what did I do wrong and how can I fix this problem?

inb4. The same effect happened with the script at the bottom, and the same effect for a website that is both online and offline.

Would be grateful for any help

+3


source to share


3 answers


Use IFrame instead of Javascript SDK. I had the same problem and it worked for me.



enter image description here

+4


source


Are you testing locally? To do this, you need to set up a server.



+3


source


when testing locally, try changing

js.src = "//connect.facebook.net/pl_PL/sdk.js#xfbml=1&version=v2.4";

      

to

js.src = "http://connect.facebook.net/pl_PL/sdk.js#xfbml=1&version=v2.4";

      

no guarantees though

+1


source







All Articles