Question

I'm updating the like facebook button in my website I just followed the instructions in the facebook developer page, I'm getting the following error:

Uncaught Error: No version specified that's located in the line 82 of the facebook SDK (sdk.js)

the code is the following:

<div class="fb-like" data-href="https://www.facebook.com/fan-page-x" data-layout="button" data-action="like" data-show-faces="true" data-share="true"></div>

<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&appId=xxxx&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

The like button appears on the page but I get the error in the console.

Was it helpful?

Solution

make sure you don't have another FB JS SDK initialization code in your page.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top