Uncaught Error: No version specified facebook sdk
Asked Answered
K

1

2

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.

Karlin answered 15/5, 2014 at 3:3 Comment(3)
I'm guessing you got the code from developers.facebook.com/docs/plugins/like-button . I would file a bug at developers.facebook.com/bugs .Lucrecialucretia
yes, the code is from the developers page!Karlin
Then file a bug so we can fix the exampleLucrecialucretia
T
2

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

These answered 20/5, 2014 at 9:22 Comment(1)
If we have another FB JS SDK initiation how to add this? I mean How to add comments and likesRosco

© 2022 - 2024 — McMap. All rights reserved.