0

i am trying to integrate facebook share button in my website.

so i got this code when i google it.

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=xxxxxxxx";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script> 


<div class="fb-share-button" data-href="http://myhomepage.com" data-type="link"></div>

it working fine. but what i want is customize my title,summary,image.

i read this link but not getting how to do this.

can any one help me on this.

thank you.

Community
  • 1
  • 1
user3184286
  • 97
  • 3
  • 11
  • possible duplicate of [facebook share button with custom title, description, and image](http://stackoverflow.com/questions/5257075/facebook-share-button-with-custom-title-description-and-image) – Sumit Bijvani Feb 19 '14 at 07:37
  • thank you for reply.but i want share button like this only. is there any way to achieve my goal. any alternate solution? – user3184286 Feb 19 '14 at 07:44

2 Answers2

0

In order to customise the information that is being published, you need to set up Open Graph tags within your page.

See this link for more information on Open Graph

https://developers.facebook.com/docs/opengraph/getting-started

This requires you to set up a Facebook Application and call the Facebook SDK

terrorfall
  • 1,121
  • 3
  • 16
  • 33
0

Try to use og-meta-tags into the head tag like this:

<head>
<meta property="og:image" content="your_image_url"/>
<meta property="og:title" content="your_title"/>
<meta property="og:description" content="your_description"/>
</head>

and that's it.