Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook opengraph and AJAX content

Tags:

facebook

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

like image 854
jeremy Avatar asked Oct 13 '22 18:10

jeremy


1 Answers

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.

like image 151
Joe Purcell Avatar answered Feb 24 '23 00:02

Joe Purcell