1

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.

2
  • have you added a Facebook application. if not, I think you have to add a facebook application, and set website URL there. Otherwise it won't work. Commented May 6, 2014 at 3:03
  • I don't have application. I was hoping that I won't need it. I have simple WEB page and I just want to share it's content. For now it's working with the accepted answer below. Tnx. Commented May 6, 2014 at 14:23

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

And how are you passing the image, title and description? With meta tags or some other way?
0
FB.ui({ method: 'feed', link: 'https:link_to_be_shared', caption: 'An example caption', }, function(response){}); 

see here for more details. here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.