Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Facebook like box doesn't show

1:09 pm on Nov 6, 2015 (gmt 0)

New User

5+ Year Member

joined:Dec 7, 2011
votes: 0

I am trying to insert the facebook like box in html page and i am following this guide [developers.facebook.com...]
I am inserting the JavaScript SDK code after the 'body' tag and then i insert the code for the like box but when i load the page the facebook like box doesn't appear. Am i doing something wrong?
3:47 pm on Nov 6, 2015 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
votes: 311

The page you've linked to is not intended to add a Facebook Like Box to your website, it is intended to share your Facebook page with visitors to your site so they can visit that page and interact with it and with other visitors. For it to work, you need to replace the default Facebook URL with your Facebook Page URL.

Try this page: [developers.facebook.com...] to add a Like Button.
5:50 pm on Nov 6, 2015 (gmt 0)

New User

5+ Year Member

joined:Dec 7, 2011
votes: 0

This is how i am entering the code in the page but it doesn't work:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

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

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

7:24 pm on Nov 6, 2015 (gmt 0)

Senior Member from GB 

joined:Oct 2, 2003
posts: 1019
votes: 39

Hi there mike75,

it will not work locally.

To see the "like button" in all it's glory, you must
upload the containing document to your site.

Alternatively, you can install a program like...
XAMPP [apachefriends.org] or EasyPHP [easyphp.org] as a test server.

8:04 pm on Nov 6, 2015 (gmt 0)

New User

5+ Year Member

joined:Dec 7, 2011
votes: 0

Yes, i uploaded the page on a server and it worked.