Reputation: 19
I am trying to load the Facebook like box on my webiste and when I go to get my code, I get a message that says "this content can not be displayed, To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame."
<div class="fb-like-box" data-href="facebook.com/pages/Cohen-Nutrition/…; data-width="292" data-show-faces="true" data-stream="false" data-header="true"></div>
<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2??Fpages%2FCohen-Nutrition%2F153878864726298%3Fref%3Dtn_tnmn%23%21%2Fpages%2FCohen-Nutrition%2F153878864726298%3Fsk%3Dwall&width=292&height=290&colorsc??heme=light&show_faces=true&border_color&stream=false&header=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:290px;" allowTransparency="true"></iframe>
I then put the code into my website widget and I get the same message mentioned above on my website where the Facebook like box should be.
Please help, I have no idea what to do and how to change this!
Upvotes: 1
Views: 10029
Reputation: 895
I just had a weird problem with a client's facebook page. The script didn't run and it didn't give any reasons. After looking in the my client's facebook page settings, I noticed he had an extra option saying "18+ yrs old" because he was selling massage oil. And because of that, the facebook box never shows on the website unless you're logged in and 18+.
Hope this can help you
Upvotes: 0
Reputation: 722
I ran into this problem as well. In my case, I was testing a static HTML page, and I was loading it in my browser with file://. I spent a while trying to figure this out, and before I uploaded my file, I tried deploying it as part of a service on http:// localhost (no space, that was just to let the post get through). Then it started working. I guess there's some logic that makes this fail when not behind a server. I hope this helps.
Upvotes: 1
Reputation: 2837
Try using HTML5 version of the code and follow the instructions. Also important is the APP ID.
<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/all.js#xfbml=1&appId=<YOUR_APP_ID>";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like-box" data-href="..." data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div>
Upvotes: 0