0
votes

I'm having a problem with sharing in facebook.

I have several images corresponding to projects. Below each image I have a share button but I don't want to share all page... just share this project (image/title/description).

Is this possible to do? I've been searching and what I got is:

function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}

" onclick="return fbs_click()" target="_blank">Share on Facebook

the problem is that when I share, the share content is all page and not that particular project.

Thanks in advance for any help.

1

1 Answers

1
votes

Take a look at this tutorial on HyperArts. Upgrading your code to the latest methods will give you the functionality you are looking for.

Inside the javascript call, you can specify the image, title, and description like you are asking for.

Example from the tutorial:

FB.ui(
{
    method: 'feed',
    name: 'HyperArts Blog',
    link: 'http://hyperarts.com/blog',
    picture: 'http://www.hyperarts.com/_img/TabPress-LOGO-Home.png',
    caption: 'I love HyperArts tutorials',
    description: 'The HyperArts Blog provides tutorials for all things Facebook',
    message: ''
});