Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Like Box doesn't work

I've been having a problem with a facebook like-box for a client, and me and a friend simply can't figure out what we're doing wrong, and it's been close to three days of staring at it. Here's the code we get from developers.facebook.com:

    <div id="fb-root"></div>
    <script>(function(d){
      var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
      js = d.createElement('script'); js.id = id; js.async = true;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
      d.getElementsByTagName('head')[0].appendChild(js);
    }(document));</script>
    <div class="fb-like-box" data-href="http://www.facebook.com/pages/mywebsite/11111111111"      
data-width="280" data-colorscheme="dark" data-show-faces="true" data-stream="true" data-header="false"></div>

Nothing shows up. We did get this piece of code to work, but it doesn't quite work the way we want to:

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like-box href="http://www.facebook.com/pages/mywebsite/1111111111" width="280" colorscheme="dark" show_faces="true" border_color="" stream="true" header="false"></fb:like-box>

You have to log in to facebook to see the feed, but the client want it to always show up.

like image 640
mrkerlin Avatar asked Dec 31 '25 11:12

mrkerlin


1 Answers

You need to add http: in line 5 of the head script like this...

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

its a html5 thing.

like image 168
will Avatar answered Jan 03 '26 01:01

will



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!