0

I've been trying to figure out why the code for my likebox will not work when I paste it into my page but it will load just fine when the same code is used in an html file. I got the code from the official facebook dev generator. The script code is in header.php and the code with the div that should call the js up is in the body of the message as raw html. Still, I'm getting nothing.

Has anyone else experienced this?

The following code will work when loaded from my computer. Will not work when I upload the same file to (loft3.com/hp.html) or when I try to use the code in header.php and call the second part in my post.

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

<div class="fb-like-box" data-href="http://www.facebook.com/hp" data-width="800" data-show-faces="true" data-header="false" data-stream="true" data-show-border="false"></div>   
</body>
</html>
brasofilo
  • 25,496
  • 15
  • 91
  • 179
  • *`will not work when I paste it into my page`* -> what is the HTML source for the LikeBox when viewing the page? Is it ok? Any JavaScript errors in the console? Maybe [this](http://stackoverflow.com/q/6195635/1287812) has something to do with it? – brasofilo Aug 19 '13 at 21:15
  • The file I uploaded to loft3.com/hp.html, when loaded from my desktop though any browser takes a second but it displays HP's facebook feed. The moment I put it anywhere online (including embedding it in a WP page), it just remains blank. I suspect if you download the source of this page to your pc it will work, but it will not load when uploaded. I'm confused by this. – Jerzy Glica Aug 21 '13 at 16:06
  • Please, [edit] your Question and show clearly: 1) *What* code are you pasting (that loft3 code). 2) *Where* are you pasting it. 3) *How* it ends up showing in your site. . . . . . Also, did you read the link I provided? – brasofilo Aug 21 '13 at 16:25
  • I did read the post. it did not help, esp now since I cant get this to work outside of WP either. The code for loft3.com/hp.html will follow in second comment post. It will work when loaded from my computer. Will not work when I upload the same file to (loft3.com/hp.html) or when I try to use the code in header.php and call the second part in my post. – Jerzy Glica Aug 21 '13 at 16:39
  • – Jerzy Glica Aug 21 '13 at 16:40

0 Answers0