我正在使用 Javascript SDK 在我们的网站上实现 Facebook“点赞”按钮。
它工作得很好,但是当用户发表评论时,该消息会链接回 <head> 部分中的规范链接。
这是非常不受欢迎的行为。为什么要麻烦手动提供一个链接来覆盖它?
有人知道解决方案吗?
我正在使用 Javascript SDK 在我们的网站上实现 Facebook“点赞”按钮。
它工作得很好,但是当用户发表评论时,该消息会链接回 <head> 部分中的规范链接。
这是非常不受欢迎的行为。为什么要麻烦手动提供一个链接来覆盖它?
有人知道解决方案吗?
不 - 这是 Like 系统的一个功能。
这就是它如何知道对看起来完全不同的 URL 的“喜欢”实际上是对同一个资源的。这样做是故意的——我同意实施。
简而言之 - 这是按预期行事。要么转储规范链接,要么以不同的方式实现它。
I agree that this should be the behaviour; partly because I can't think of a reason to specify a canonical link that you don't want to use?
I found this question because I had the opposite problem in that my canonical link seemed to be being ignored, so I presume they have fixed this feature in Facebook
For me the data-href attribute overrides the canonical meta tag
<div class="fb-like" data-href="YOU_LINK_GOES_HERE" data-send="false" data-layout="button_count" data-width="45" data-show-faces="false" data-font="lucida grande"></div>