Facebook'Like'按钮和#个URL字符串? [英] Facebook 'Like' buttons and # URL strings?

查看:139
本文介绍了Facebook'Like'按钮和#个URL字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果它们是指相同的页面但是使用不同的#字符串,那么Facebook在ajax网络应用程序中使用Like按钮做什么?他们作为不同的页面喜欢?



例如,如果我得到4点击:

  mysite.com/articles#story1 
mysite.com/articles#story2
mysite.com/articles#story3
mysite.com/articles#story4






用户的新闻稿将出现什么

  4人喜欢mysite.com/articles 

  dave喜欢mysite.com/articles#story1 
tom喜欢mysite.com / articles#story2
ben喜欢mysite.com/articles#story3
nick喜欢mysite.com/articles#story4






有没有其他的事情要考虑到FB和#字符串?

解决方案

Facebook的按钮使用元数据嵌入在单个页面的HTML标记中。如果您的URL在curl访问时产生不同的元数据(即没有JavaScript,我认为是不可能的,因为哈希部分不被看到服务器端),那么在理论上可以工作,所以没有办法对散列字符串值服务器端)



所以说过,我会假设Facebook Like按钮在不同的哈希字符串上的行为不同。看看facebook文档(主要是吮吸)没有提到,但是Facebook开发者论坛似乎证实了这一点: http://forum.developers.facebook.com/viewtopic.php?pid=240151



但是,所有的都不会丢失。您可以指定类似按钮的URL,因此只需将URL设置为同一页面的SEO友好URL: http://developers.facebook.com/docs/reference/plugins/like



更新 - 从评论中澄清

h1>

所以,现在我们知道你有静态版本的哈希字符串URLS。之前,您最有可能使用此代码放置在页面上的按钮:



XFBML:

 < fb:like show_faces =falsewidth =450>< / fb:like> 

相反,您应该指定URL的SEO版本。例如,当您使用 mysite.com/articles#story4 时,代码应如下所示:



XFBML: / strong>

 < fb:like href =mysite.com/articles/story/4show_faces =false宽度= 450 >< / FB:像> 


What does Facebook make of 'Like' buttons in a ajax web app if they are referring to the same page but with a different # string?

Does it treat them as different pages to 'like'?

for example if i get 4 like clicks:

mysite.com/articles#story1
mysite.com/articles#story2
mysite.com/articles#story3
mysite.com/articles#story4


what will come up in the users' newsfeed

4 people like mysite.com/articles

or

dave likes mysite.com/articles#story1
tom likes mysite.com/articles#story2
ben likes mysite.com/articles#story3
nick likes mysite.com/articles#story4


are there any other things to think about with FB and # strings?

解决方案

Facebook's like buttons use metadata that are embedded in the HTML markup of a single page. It would work in theory if your URL's produce different metadata when accessed by curl (i.e. without JavaScript, which I believe is not possible since the hash portion is not seen server-side, so there is no way to act on hash string values server side).

So having said that, I would assume that Facebook Like buttons don't behave differently for different hash strings. A look at the facebook documentation (which mostly sucks) doesnt mention this, but the facebook developer forums seem to confirm this: http://forum.developers.facebook.com/viewtopic.php?pid=240151

However, all is not lost. You can specify the URL of a like button, so just set the URL to be the SEO-friendly URL of the same page: http://developers.facebook.com/docs/reference/plugins/like

UPDATE - Clarifying from the comments

So, now that we know you have static versions of the hash string URLS. Before, you were most likely placing like buttons on the page with this code:

XFBML:

<fb:like show_faces="false" width="450"></fb:like>

Instead, you should be specifying the SEO version of the URL. For example, when you're on mysite.com/articles#story4, the code should look like:

XFBML:

<fb:like href="mysite.com/articles/story/4" show_faces="false" width="450"></fb:like>

这篇关于Facebook'Like'按钮和#个URL字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆