Facebook Page Plugin giving "Failed to load Resource"

Asked

Viewed 548 times

3

I would like to use the plugin "page" Facebook, but I’m not getting it. After adding this code at the beginning of the tag 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/pt_BR/sdk.js#xfbml=1&version=v2.5";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script> 

and the one at the end tag "body"

<div class="fb-page" data-href="https://www.facebook.com/l2akhilleus/timeline/" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-show-posts="true">
<div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/l2akhilleus/timeline/"><a href="https://www.facebook.com/l2akhilleus/timeline/">L2Akhilleus</a></blockquote></div></div>

I update the page and does not load or show anything. I went to inspect page element and it returned me this and I do not know how to proceed:

file://connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.5 Failed to load Resource: net::ERR_FILE_NOT_FOUND

I already went to this link and copied all the code and saved in a file, called the code <script type="text/javascript" src="js/sdk.js"></script> and still does not show the plugin on my page...

2 answers

3


Apparently the problem is being assumed that the resource is on the computer, perhaps because you are leaving the URL without protocol. If you look at the error message, the searched resource is starting with file://.

Try to use:

js.src = "https://connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.5";
  • Perfect! I put it online and it worked!

0

Mine just worked out this way

old code

//connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.10&appId=

adjusted code

//connect.facebook.net/pt_BR/sdk.js#xfbml=1&amp;version=v2.10&amp;appId=

I added one "amp;" after the "&"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.