Facebook点赞按钮消失

4
我在我的网站上使用Facebook点赞按钮时遇到了问题: 添加以下代码(由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;">

我尝试解决可能存在的url问题并更改了一些url,我发现按钮在新的url中显示,在几天后,某些页面会丢失按钮。

这是加载没有“喜欢”按钮的页面后来自Facebook的所有代码:

<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>

最明显的区别在于:
<html lang="it" id="facebook" class="no_js">    

在工作页面中有class=""的代码。

有没有人能帮忙或者给一些提示让我理解发生了什么?


谢谢回答,但这不是解决方案,这是Facebook提供的代码,并且在创建URL时有效,只有一些页面在几天后停止工作。无论如何,我在Facebook开发者网站上找到了一个已知的中等优先级错误。

2个回答

2
这似乎是这个 bug:

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

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

基本上,如果您正在创建带有“赞”按钮的Facebook应用程序是:
  • 处于“沙盒”模式,或
  • 与生成“赞”按钮的域不同
那么就会出现这个问题。可以通过转到https://developers.facebook.com/apps/并选择相关应用程序来更改这两个设置。
在我的情况下,我最初将应用程序URL设置为 localhost 进行开发。我已添加了正确的URL以及我们使用的子域,但尚未重新开始工作。随着进一步的了解,我将更新此答案... 更新 尽管建议更改应用程序设置,但这并没有起作用。我现在正在研究其他异步调用的问题:

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

看起来其他人也遇到了同样的问题:

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


-1

你需要在 iframe 的链接中添加 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;">

那不应该是问题。协议被有意地省略,因为它是从主机页面中获取的。运行在https上的页面将包括https://www.facebook.com/...,而运行在普通http上的页面将使用http://www.facebook.com/...。 - digitalbreed

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接