fernandohur
fernandohur

Reputation: 7154

Make Facebook link previews work with ajax website

Everyone knows if you copy a link from an html website on to facebook it will try to get available images like previews for the link. However, if the content is generated dynamically, like with js, facebook wont read that content. Is there a way out of this?

Upvotes: 0

Views: 740

Answers (1)

waffle paradox
waffle paradox

Reputation: 2775

Facebook's preview mechanism lets you set your own metadata and change the preview image, title, short site description, etc. In this case, you can set your preview image with:

<meta property="og:image" content="/images_folder/image.jpg"/>

This is in accordance with the open graph protocol, which you can read more about here: http://developers.facebook.com/docs/opengraph/

Upvotes: 1

Related Questions