Facebook Button not showing up

喜欢而已 提交于 2019-12-11 18:53:43

问题


I've looked at the other post on here for issue's with Facebook like button not showing up and can't seem to figure out why in the world the Facebook like button I am trying to add is not showing up. I've followed the steps on the FB developer page but still not showing. Here is my code. Is there something wrong that I am not seeing or doing?

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

<div class="fb-like" data-href="http://www.winvipconcert.com"data-width="350" data-show-faces="false" data-send="false"></div>

回答1:


Your code works fine for me on chrome and firefox. My guess is this is a styling issue. Check the styles of the container that wraps the div.fb-like




回答2:


Try the following, there is little difference between your code but see if it works.

<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 = "http://connect.facebook.net/en_US/all.js#xfbml=1&appId=1402069220010998";
  fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));
</script>


来源:https://stackoverflow.com/questions/18020641/facebook-button-not-showing-up

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