Facebook opengraph和AJAX内容 [英] Facebook opengraph and AJAX content

查看:120
本文介绍了Facebook opengraph和AJAX内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含AJAX内容的应用程序,我希望用户能够共享网页的内容,由网址的哈希/锚定部分确定(URL之后的内容)。也就是说,我想根据URL的哈希部分确定开放标记的值。



Google有一个机制: http://code.google.com/web/ajaxcrawling ... arted.html



Facebook?



谢谢

解决方案

是。



Facebook以与Google相同的方式处理AJAX网站。具有hashbang的URL将替换为_escaped_fragment_参数。



比较以下内容:







http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Flikeapage.com%2FChristmas %2Fvs%2FBacon



确保Open Graph信息(如URL)与真实页面匹配。否则,FB会出错,就像我遇到的问题一样。


I have an application with AJAX content and I want users to be able to share URLs where the content of the page is determined by the hash/anchor portion of the URL (the stuff after '#'). That is, I want to determine the values of the opengraph tags based on the hash portion of the URL.

Google has a mechanism for this: http://code.google.com/web/ajaxcrawling … arted.html

Does Facebook?

Thanks

解决方案

Yes.

Facebook handles AJAX sites the same way Google does. URLs with a hashbang are replaced with the _escaped_fragment_ parameter.

Compare the following:

http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Flikeapage.com%2F%23!%2FChristmas%2Fvs%2FBacon

and

http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Flikeapage.com%2FChristmas%2Fvs%2FBacon

Be sure that the Open Graph information, such as the URL, matches up with what the real page. Otherwise, FB will error, as was the issue I had.

这篇关于Facebook opengraph和AJAX内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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