-1

I want to embed a facebook post to my html code. So I clicked on the post and chose "Embed Post" and got the below code.

<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.3";  fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script><div class="fb-post" data-href="https://www.facebook.com/Hi.iCreations/posts/723687861101376" data-width="500"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/Hi.iCreations/posts/723687861101376"><p>Long waited Documentary trailer ReleasedWater is a vital part of almost all life on Earth. We need a safe source of...</p>Posted by <a href="https://www.facebook.com/Hi.iCreations/">Icreations</a> on&nbsp;<a href="https://www.facebook.com/Hi.iCreations/posts/723687861101376">Wednesday, March 9, 2016</a></blockquote></div></div>

When I paste it in my HTML code, below is how it displays it.

enter image description here

It is not displayed as a post! There are couple of examples as answers for this question.How to embed a Facebook page's feed into my website It says, run the example and when I run it I get the same output. Only the hyperlink is displayed, not the post. Is this some known issue with facebook api? or else is there a workaround? Please advice.

Community
  • 1
  • 1
AnOldSoul
  • 4,017
  • 12
  • 57
  • 118
  • Are you calling the page you are testing this on using `http://` or `https://` in your browser? The protocol-relative URL the above code uses to embed the SDK will only work if that is the case. – CBroe Apr 04 '16 at 15:05

1 Answers1

1

Hmmm it seems to work at my page.

enter image description here

I have tested it in my own webpage and it seem to work on every browser. The only thing I can imagine is that you don't have a API installed right, what is a bit strange because its working on my page even when I am not logged in on facebook or anything, or there must be a javascript function that ruins the script from facebook..

I suggest to make your own api, and then go to https://developers.facebook.com/docs/plugins/embedded-posts. There, you can paste in your post and generate the code. If it is still not working I suggest to paste it in, and than remove every line of code untill it work to see what is distrubing your code.

Giesburts
  • 6,879
  • 15
  • 48
  • 85
  • I pasted it in a simple html file and still doesn't load. I haven't installed any API! I just copied the code from embed post and pasted it. How do i install the API? – AnOldSoul Apr 05 '16 at 00:54
  • you should login to https://developers.facebook.com/, from their on you see a dropdown at the top right with "My Apps" and then you have to select "Add a new app" – Giesburts Apr 05 '16 at 07:02