문제

I want to add the standard facebook share button (button_count) as this one: enter image description here

I'm trying to do this a couple of days, so I will need your help. I'm using the code from code placed at this link: developers.facebook.com. So as I understood, I place this code

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

right after the <body> tag, and this code

<div class="fb-share-button" data-href="<<here_is_my_URL>>" data-type="button_count"></div>

at the place where I want the button to appear. But when I try to load the page, the button is not showing on my page and I got the error:

   Refused to display 'https://www.facebook.com/undefined/plugins/share_button.php?app_id=&channel…s.facebook.com%2Fdocs%2Fplugins%2F&locale=mk_MK&sdk=joey&type=button_count' in a frame because it set 'X-Frame-Options' to 'DENY'.

How can I implement this functionality on my webpage? It's very important to have the same design as the button in the image above, and to have counter. Any help will be appreciated.

도움이 되었습니까?

해결책

I managed to get it to work. Simply use the XFBML version of the button and not the HTML5.

다른 팁

FB.ui({
  method: 'feed',
  link: 'https:link_to_be_shared',
  caption: 'An example caption',
}, function(response){});

see here for more details. here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top