user613507
user613507

Reputation: 41

facebook share button not reading og tags

I have this code to make Facebook share, but this doesn't read my og meta tags. Putting in the Facebook debugger it reads fine.

<h2 class="caixacsstitulo"><%# Eval("titulo") %>
<div class="fb-share-button" data-href="http://www.novaonda.no-ip.info:8080/detalhe_noticia.aspx?id=<%# Eval("id") %>" data-type="box_count">
</div>
<asp:Image ID="Image3" runat="server" Width="32px"  ImageUrl='<%# Eval("destaque") %>' Height="32px" ImageAlign="Right" /></h2>

https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-ash3/t39.2087/851580_449013558558148_825231171_n.jpg

You can access it here

Upvotes: 1

Views: 10603

Answers (3)

Joe Angel
Joe Angel

Reputation: 11

I'm using bellow code, works well for me

<script src="//connect.facebook.net/zh_TW/sdk.js#xfbml=1&version=v2.8"></script>

using above code instead of Facebook share-button step 2:

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

Upvotes: 0

LoveOopura Comebaak
LoveOopura Comebaak

Reputation: 1

Those who have copied the code and pasted on the web page we need to add the class attribute "class="fb-share-button" " to the div that will show the Share button. The automatically generated code from the Facebook is missing this attribute, and that is it does not display the facebook button. Also, the button appears when the page is loaded or viewed from a web server. If you preview web page on the local computer the while designing it does not show up. Third thing that you need to check is that there are no errors in loading the js "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5"//

Upvotes: 0

Code Killer
Code Killer

Reputation: 11

Facebook officially deprecated the share button in favor of the like button earlier this year. A few days ago, I realized that the share button no longer displays on sites I manage. Trying to figure out what could be wrong, I checked those sites using a different browser and it was the same. Still in doubt, I used a different PC and even checked other websites just to be sure. Across the web, a certain version of Facebook share button stopped working. The Share Button has been deprecated already a while ago but not yet completely dead. If it stops working on your website or blog, you only need to update your code. Facebook deprecated the Share button on February 28, which means they no longer recommend its use in applications or on external web sites. Also, a certain version of Facebook share button was deprecated several years ago, and Facebook switched to serving the new JS SDK in its place on Monday, July 16. Perhaps the old one will be brought back to life later, but then I guess it’s time to upgrade to the new version. Support has already been dropped for it so there’s no point complaining to Facebook. How to fix your share button

I prefer using the share button because it lets me share to my fan pages, unlike the like button which Facebook now favors. I found three fixes to this which I think should do the trick. 1. Using the official JD SDK version

  • Search for http://ogp.me/ns/fb#” just after it. The resulting code should lok like this:

"

If this is already there, you don’t need to do it again. - In the body of your website where you want the code to display, paste this:

<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=YOUR_APP_ID"; // appId must be valid
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:share-button type="box_count">
</fb:share-button>

Hey, make sure you change these parameters for the code to work: * YOUR_APP_ID – You must create a facebook application for this code to work. Don’t know how? I explained it on steps 1 and 2 of this post. * You can change box_count to button_count if you want a smaller button instead of the large one with counter.

Upvotes: 1

Related Questions