2

Update: the button is back : Facebook Share button: is it officially dead?


I have a strange problem. The Facebook share button has stopped displaying. The code used is

<p style="margin-top:-50px; margin-left:300px; width:600px;">Join us on Facebook
  <a name="fb_share" type="button" share_url="https://example.com/"></a>
  <script src="https://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript">
  </script>
</p>

The code has not been changed since I was assigned to handle the website. Any ideas why this is happening? The HTML is there. But no button appears.

Community
  • 1
  • 1
inarilo
  • 804
  • 1
  • 9
  • 14
  • possible duplicate of [Facebook Share button: is it officially dead?](http://stackoverflow.com/questions/11537996/facebook-share-button-is-it-officially-dead) – mark4o Jul 19 '12 at 03:29
  • It is the same issue - and the button is back :) Thanks to Sean Kinsey, I presume :) – inarilo Jul 19 '12 at 03:54

1 Answers1

6

Facebook no longer use that.

Instead Use the below code.

And paste this after opening <body> tag

<div id="fb-root"></div>{literal}
<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=YOUR APP ID HERE";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>{/literal}

Anywhere you want this to appear, add this code:

<fb:share-button type="box_count"></fb:share-button>

Make sure you change the App ID, You must create app first

Sagar V
  • 12,158
  • 7
  • 41
  • 68
Bini
  • 61
  • 1