Max M.
Max M.

Reputation: 86

Facebook Like button 404 error for connect.facebook.net/en_US/all.js

When trying to add a Facebook like button, my browser is getting a 404 error when attempting to load the FaceBook SDK from: connect.facebook.net/en_US/all.js

Chrome developer tools shows the following:

GET http://connect.facebook.net/en_US/all.js#xfbml=1 404 (Not Found)

Referencing: https://developers.facebook.com/docs/reference/plugins/like/ I inserted the following right before <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/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Then I added the following where I wanted my like button:

<div class="fb-like" data-href="http://developers.facebook.com/docs/reference/plugins/like" data-send="false" data-width="450" data-show-faces="false"></div>

Note: Using the default dev test data-href as an example.

Upvotes: 1

Views: 3131

Answers (1)

Max M.
Max M.

Reputation: 86

I noticed that it worked when I accessed my page from another network.

Digging into it further, I found that it was a firewall on our network that was blocking requests to connect.facebook.net/en_US/all.js.

Upvotes: 1

Related Questions