0

I have implemented the facebook share feature in JavaScript. So far, when i click, a popup show up with the title of the document, the url and an image. I need to add a small description like this one:

enter image description here

So far, my code is this:

window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent('http://xxxxx.com/myblog')+'&t='+encodeURIComponent(''),'sharer','toolbar=0,status=0,width=626,height=436'); 

Is there any thing to add to make the description appear on the sharer popup window?

Malloc
  • 15,434
  • 34
  • 105
  • 192

1 Answers1

1

On the page you want to share (http://xxxxx.com/myblog) you need to add the FB Open Graph Tags

<meta property="og:url" content=""/>
<meta property="og:type" content="article"/>
<meta property="og:title" content=""/>
<meta property="og:image" content=""/>
<meta property="fb:app_id" content=""/>

This tag add the description

<meta property="og:description" content="xyz">

Read more @ http://developers.facebook.com/docs/opengraphprotocol/

MagePal Extensions
  • 17,646
  • 2
  • 47
  • 62
  • Hi, thanx for your reply, seems all meta tags you mention are required, i can manage them except the `fb:app_id`, from where can i get one? – Malloc Oct 21 '12 at 14:00
  • Do you have a facebook fan page, facebook app or facebook account? Log into facebook and then go to this url http://developers.facebook.com/docs/reference/plugins/like/ it will should you your 'admin id' (fb:admins or fb:app_id - A comma-separated list of either the Facebook IDs of page administrators or a Facebook Platform application ID. At a minimum, include only your own Facebook ID.) – MagePal Extensions Oct 21 '12 at 14:13
  • You may also need to 'Clear Facebook Share Cache' before some pages will work eg. http://stackoverflow.com/questions/5256114/how-to-clear-facebook-sharer-cache – MagePal Extensions Oct 21 '12 at 14:14
  • I do what you list, all seems work fine, the cache operation return me `Scrape Information--> response code: 206` but, the description isn't shown yet, does it take time for facebook to update that? – Malloc Oct 21 '12 at 16:46
  • Try testing a page that you have not try before (or add a token to the url so that facebook will fetch a new copy eg. www.xyz.com/?test=fb... where test=fb is the token ). You may want to view source in your browser to make sure the og:description is on the page first. Once you get it working then you can remove the token – MagePal Extensions Oct 21 '12 at 16:55