Uncaught Error: No version specified facebook sdk

ε祈祈猫儿з 提交于 2019-12-11 03:12:15

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/23668541/uncaught-error-no-version-specified-facebook-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!