javascript - facebook link preview generation -
i include facebook link preview on page. have website registered facebook app. have input , every time user enters url there, show same preview in facebook during wall post. how can this?
thanks, alex a.
basically need make request html of page want preview. web developers put stuff want in facebook preview in meta tags in head. this:
<meta property="og:image" content="http://image.png">
then have stuff using jquery
var imgsrc = $(html).filter('meta[property="og:image"]').attr('content');
and put wherever
document.getelementbyid("wherever").innerhtml = '<img src="' + imgsrc + '" />';
edit: sorry realized wanted facebook api. don't have method that, you're going have make own.
Comments
Post a Comment