Facebook button as a button disappears

I have a problem with the Facebook Like button on my website: adding this code (provided by facebook)

<iframe allowtransparency="true" frameBorder="0" src="//www.facebook.com/plugins/like.php?href=http://my.site.com/folder/&send=false&layout=button_count&width=120&show_faces=false&action=like&colorscheme=light&font&height=20" style="border:none; overflow:hidden; width:450px; height:20px;"> 
Button

it displays correctly on any page as it is created, after a few days on some pages the iframe remains blank because Facebook no longer sends the button code.

I tried to solve possible problems with the urls and change some urls. I noticed that the button appears in the new URLs, after a few days the button is lost on some page.

This is all the code coming from Facebook after the page without loading the Like button:

 <html lang="it" id="facebook" class="no_js"> <head> <meta charset="utf-8"/> <meta name="robots" content="noodp, noydir"/> <meta name="referrer" content="default" id="meta_referrer"/> <meta name="description" content=" Facebook è una piattaforma sociale che ti consente di connetterti con i tuoi amici e con chiunque lavori, studi e viva vicino a te. Puoi usare Facebook per rimanere in contatto con i tuoi amici, caricare tutte le foto che vuoi, pubblicare link e video o per saperne di più sulle persone che incontri."/> <script/> <title>Facebook</title> <script>var onloadRegister_DEPRECATED=function(){},onafterloadRegister_DEPRECATED=function(){},ServerJSQueue={add:function(){}}; </script> <style type="text/css"> div.fbNubFlyoutBody.scrollable{position:inherit} </style> <script>ServerJSQueue.add({"require":[["lowerDomain"],["Primer"]]});</script> </head> <body class="opera Locale_it_IT"> <div id="FB_HiddenContainer" style="position:absolute; top:-10000px; width:0px; height:0px;"/> <script>function envFlush(a){function b(c){for(var d in a)c[d]=a[d];}if(window.requireLazy){requireLazy(['Env'],b);}else{Env=window.Env||{};b(Env);}} envFlush ({"fb_dtsg":"XXXXXXXXXX","ajaxpipe_token":"XXXXXXXXXXXXXXXX","lhsh":"XXXXXXXXX","user":"XXXXXXXXXXXXXXX"});</script> <script> </script> </body> </html> 

The most obvious difference is this:

 <html lang="it" id="facebook" class="no_js"> 

which is on the work pages class = "". There is still a lot of code on the working pages ...

Can someone help or give a hint so that I can understand what is happening?


Thanks for the answer, but this is not a solution, this is the code provided by facebook, and, as I said, it works while the URL is being created and, for some pages only, stops working after a few days. In any case, I found a known mistake with medium priority on the facebook developers site.

+4
source share
2 answers

It looks like this could be this error:

http://developers.facebook.com/bugs/335818753176892/

http://developers.facebook.com/bugs/130242697118406/

Essentially, if in a Facebook application you create a Like button with:

  • In sandbox mode or
  • Has another domain that generates a Like button, on

Then this problem may appear. Both of these options can be changed by going to https://developers.facebook.com/apps/ and selecting the appropriate application.

In my case, I initially set the localhost application url for development. I added the correct URL along with the subdomains that we use, but so far it has not started working. I will be updating this answer with more information as I go ...

Update

This does not work, despite the recommended changes to the application settings. Now I am considering this problem with other asynchronous calls:

http://developers.facebook.com/bugs/353458578076232?browse=search_506192588df614017400920

And others seem to have the same problem:

http://developers.facebook.com/bugs/498181603534748?browse=search_506192588df614017400920

+2
source

Incorrectly in the ifream link, you must add http: //

 <iframe allowtransparency="true" frameBorder="0" src="http://www.facebook.com/plugins/like.php?href=http://my.site.com/folder/&send=false&layout=button_count&width=120&show_faces=false&action=like&colorscheme=light&font&height=20" style="border:none; overflow:hidden; width:450px; height:20px;"> 
-1
source

All Articles