Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
类似Facebook的按钮不起作用_Facebook_Button_Facebook Like - Fatal编程技术网

类似Facebook的按钮不起作用

类似Facebook的按钮不起作用,facebook,button,facebook-like,Facebook,Button,Facebook Like,我使用调试器进行了检查,只有一个警告: The og:locale property should be explicitly provided, even if a value can be inferred from other tags. 顺便说一下,我找不到关于这个属性的任何信息,类似的按钮文档也没有说这是必需的 我有6个必需的标签,其他一切看起来都很好。我正在使用iframe版本的Like按钮 Like按钮显示,可以单击,然后短暂显示1计数并消失。它从那里什么也做不了。来自服务器的响

我使用调试器进行了检查,只有一个警告:

The og:locale property should be explicitly provided, even if a value can be inferred from other tags.
顺便说一下,我找不到关于这个属性的任何信息,类似的按钮文档也没有说这是必需的

我有6个必需的标签,其他一切看起来都很好。我正在使用iframe版本的Like按钮

Like按钮显示,可以单击,然后短暂显示1计数并消失。它从那里什么也做不了。来自服务器的响应是:


(;;)的
;{“u ar”:1,“payload”:{“requires_login”:false,“success”:false,“ready_connected”:false,“is_admin”:false,“show_error”:true,“error_info”:{“brief”:“发生了一个错误”,“full”:“页面出现了一个类似的错误。如果您是页面所有者,请尝试通过Facebook网站上的过梁运行您的页面。”(https:\/\/developers.facebook.com\/tools\/lint\/)并修复任何错误。“,“errorUri”:…

尝试将en_US作为区域设置的元值。我想知道Facebook是否很难确定您的页面使用的是哪种语言。

我切换到HTML 5 Like按钮,但在添加脚本文件之前,我使用jQuery动态添加了它

var $likeButton = $('<div id="like-button" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false" data-font="lucida grande"/>').addClass('fb-like').attr('data-href', window.location.protocol + '//' + window.location.hostname + '/');
$likeButton.insertBefore('.top-toolbar > .toolbar-links');

var js, id = 'facebook-jssdk';
if (document.getElementById(id)) {
  return;
}
js = document.createElement('script');
js.id = id;
js.async = true;
js.src = '//connect.facebook.net/en_US/all.js';
document.getElementsByTagName('head')[0].appendChild(js);
var$likeButton=$('').addClass('fb-like').attr('data-href',window.location.protocol+'/'+window.location.hostname+'/');
$likeButton.insertBefore('.top-toolbar>.toolbar-links');
var js,id='facebook jssdk';
if(document.getElementById(id)){
返回;
}
js=document.createElement('script');
js.id=id;
js.async=true;
js.src='//connect.facebook.net/en_US/all.js';
document.getElementsByTagName('head')[0].appendChild(js);

您的页面是否按照建议在过梁中运行?是的,它只有我发布的一条警告。这当然可以消除警告,但“Like”按钮的作用仍然相同。