Facebook Page Plugin giving "Failed to load resource"

3

I would like to use the Facebook page plugin, but I can not. After adding this code at the beginning of the body tag

 <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 this 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 refresh the page and it does not load or show anything. I went in to inspect element of the page and it returned me this and I do not know how to proceed:

  

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

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

    
asked by anonymous 10.10.2015 / 16:46

2 answers

3

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

Try to use:

js.src = "https://connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.5";
    
10.10.2015 / 18:24
0

Mine just worked as follows

old code

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

code set

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

I've added a " amp; " after the & "

    
25.08.2017 / 01:42