Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook SDK JS Not Found

Tags:

facebook

sdk

I am trying to add a Facebook Page Plug-in to my web page. I am not using any content managing systems, just plain HTML & CSS. I keep receiving the following error

"GET file://connect.facebook.net/en_US/sdk.js net::ERR_FILE_NOT_FOUND"

Here is my code. I have directly copied this from the Facebook Developers page, so I'm not sure why I'm receiving an error.

<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/en_US/sdk.js#xfbml=1&version=v2.5";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-page" data-href="https://www.facebook.com/facebook" 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/facebook"><a href="https://www.facebook.com/facebook">Facebook</a></blockquote></div></div>
like image 555
Tabitha Westfall Avatar asked Oct 23 '15 15:10

Tabitha Westfall


1 Answers

Add "https:" as a prefix of the js.src string "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5".

Because it's currently looking for a local file :)

like image 69
Alex Avatar answered Oct 10 '22 21:10

Alex