我检查了调试器,我只有一个警告:
The og:locale property should be explicitly provided, even if a value can be inferred from other tags.
顺便说一下,我找不到关于该属性的任何内容,Like Button文档也没有说明它是必需的。
我有6个必需的标签,其他一切看起来很好。我正在使用Like按钮的iframe版本。
可以单击“赞”按钮显示,然后短暂显示1个计数并消失。它没有任何作用。服务器的响应是:
for (;;);{"__ar":1,"payload":{"requires_login":false,"success":false,"already_connected":false,"is_admin":false,"show_error":true,"error_info":{"brief":"An error has occurred.","full":"There was an error liking the page. If you are the page owner, please try running your page through the linter on the Facebook devsite (https:\/\/developers.facebook.com\/tools\/lint\/) and fixing any errors.","errorUri":...
答案 0 :(得分:0)
尝试将en_US作为区域设置元值。我想知道Facebook是否很难确定您的网页所使用的语言。
答案 1 :(得分:0)
我切换到了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);