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 我们怎么能让评论和喜欢忽略来自URL的#锚定,这样整个页面只有一组评论和喜欢?_Facebook_Hash_Facebook Like_Anchor_Facebook Comments - Fatal编程技术网

Facebook 我们怎么能让评论和喜欢忽略来自URL的#锚定,这样整个页面只有一组评论和喜欢?

Facebook 我们怎么能让评论和喜欢忽略来自URL的#锚定,这样整个页面只有一组评论和喜欢?,facebook,hash,facebook-like,anchor,facebook-comments,Facebook,Hash,Facebook Like,Anchor,Facebook Comments,我总是觉得具体的例子最有帮助。。。下面是一个示例URL: http://www.humanreligions.info/humanism.html 注释和类似按钮按预期工作。但是,如果我的用户单击此链接以获取该页面,或者如果他们单击其中一个菜单项,然后碰巧刷新了该页面,则浏览器URL为: http://www.humanreligions.info/humanism.html#Organisations 并且没有来自基本页面的喜欢和评论显示出来。由于锚,FB将其视为一个全新的页面,这不是锚的

我总是觉得具体的例子最有帮助。。。下面是一个示例URL:

http://www.humanreligions.info/humanism.html
注释和类似按钮按预期工作。但是,如果我的用户单击此链接以获取该页面,或者如果他们单击其中一个菜单项,然后碰巧刷新了该页面,则浏览器URL为:

http://www.humanreligions.info/humanism.html#Organisations
并且没有来自基本页面的喜欢和评论显示出来。由于锚,FB将其视为一个全新的页面,这不是锚的意思,也不是我想要它做的

关于这一点的问题/答案(我已经搜索了一段时间,肯定其他人一定是偶然发现了这个简单的bug!)似乎都是人们希望#有特殊意义的地方。这是一年前在这里提出的问题,但没有答案

以下是页面中的相关代码片段:

类似按钮代码(简化):


评论:

<div id="fb-root"></div><fb:comments href="http://www.humanreligions.info/humanism.html"></fb:comments>

杂项:



要使FB将一个页面视为一个页面而不考虑(不可逆)内部锚定,还需要什么呢?

我知道我做这件事真的很晚了,但是当您使用XMLNS版本的按钮时,您可以在类似facebook的按钮上添加data href属性,我可以从评论部分看到正在使用该属性。因此,对于您的示例,您可以说:

<fb:like layout="box_count" action="like" show_faces="true" share="true" data-href="http://www.humanreligions.info/humanism.html"></fb:like>

我也在上问了上述问题,但该页面充斥着个人广告和垃圾评论,因此不可能将其用于任何实际用途。
<meta property="og:url" content="http://www.humanreligions.info/humanism.html">
<fb:like layout="box_count" action="like" show_faces="true" share="true" data-href="http://www.humanreligions.info/humanism.html"></fb:like>