Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want to share a particular block or div from my entire page into facebook

Tags:

facebook

share

I have a requirement that in a webpage I have multiple block of content which is wrapped inside individual DIV. Each block needs to have a share to facebook button. Did many researches but couldn't find a solution. Please can anyone give me a suitable code or idea how I can share particular blocks/content wrapped inside a div into facebook.

For e.g. I have three DIV in my page and each DIV has share button, when user clicks on any of the share button the respective DIV is shared.

Is there any solution to this requirement or whether is it possible to do. Any kind of suggestions are widely accepted.

like image 925
Subhajit Avatar asked Mar 29 '12 13:03

Subhajit


People also ask

How do I create a link button on Facebook?

To generate a Facebook Share Button, visit https://developers.facebook.com/docs/plugins/share-button and specify the URL you want people to share as well as the width. Then generate the code, and paste it into your site where you want the button to appear.


1 Answers

Check out this HyperArts tutorial on adding a Share Button to an iFrame tab - you use the exact same code for your webpage. You will be using the Facebook JavaScript SDK.

At the end of the tutorial it explains how to modify it to allow for multiple Share buttons on one page. You just need to add a unique identifier for each one.

like image 163
Luke Shaheen Avatar answered Oct 12 '22 07:10

Luke Shaheen