Forum Moderators: open

Message Too Old, No Replies

Facebook like box doesn't show

         

mike75

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

10+ Year Member



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?

not2easy

3:47 pm on Nov 6, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



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.

mike75

5:50 pm on Nov 6, 2015 (gmt 0)

10+ Year Member



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">
<head>
<title>CNN</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

</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 = "//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>


</body>
</html>

birdbrain

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



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.

birdbrain

mike75

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

10+ Year Member



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