1

I'm currently trying to use the HTML5 version of the Likebox but it is not working as expected. It doesn't work in local sites, and it also does not show the posts from the page as it should.

Here's the code:

http://jsfiddle.net/qp4qr/1/

Markup:

<div style="text-align: center;">
    <div class="fb-like-box" data-href="http://facebook.com/nbglive" data-width="234" data-show-faces="true" data-stream="false" data-border-               <div class="well blackwell">color="#007Db7" data-header="false"></div>
  </div>

Javascript code:

(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 = "http://connect.facebook.net/en_US/all.js#xfbml=1&appId=136619623172579";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

As you can see, it works ---just fine--- partially on jsfiddle. It does not work in local files and when served from the web it does what it does in jsfiddle which is to be broken.

(And at this point I'm about to blow my top at Facebook).

Rob
  • 4,927
  • 12
  • 49
  • 54
RolandiXor
  • 180
  • 1
  • 15

3 Answers3

0

Think you forgot to import Jquery

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></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/all.js#xfbml=1&appId=136619623172579";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
Grmn
  • 542
  • 2
  • 9
  • Simply follow these steps starting with 1 http://developers.facebook.com/docs/reference/plugins/like-box/ get code 1: SDK etc... – Grmn Mar 19 '13 at 05:14
0
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>The HTML5</title>
  <meta name="description" content="The HTML5 FB TEST">
  <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
</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/es_LA/all.js#xfbml=1&appId=136619623172579";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>


<div class="fb-like-box" data-href="http://www.facebook.com/platform" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div>
</body>
</html>
Grmn
  • 542
  • 2
  • 9
0

Please refer to my answer this
Facebook new Like Box (Page plugin) not working

I made it working after spending several hours, now it also working with local html files.

Community
  • 1
  • 1
Aamir
  • 16,329
  • 10
  • 59
  • 65