Closed confile closed 11 years ago
No, I don't think that there a specific share functionnality in Facebook JS SDK, there is only a Feed Dialog : http://developers.facebook.com/docs/reference/javascript/FB.ui/
You can do it with this code:
function fbShare(share) { var w = 640; var h = 460; var sTop = window.screen.height/2-(h/2); var sLeft = window.screen.width/2-(w/2); var shareUrl = 'http://www.facebook.com/sharer/sharer.php?u=' + share; var sharer = window.open(shareUrl, "Share", "status=1,height="+h+",width="+w+",top="+sTop+",left="+sLeft+",resizable=0"); }
share parameter is url to share.
Benorama, you can implement it in library
Indeed you could use the legacy sharer, even if it looks like this is not really supported by Facebook anymore.
Note: be careful with window.open, you might get blocked by popup blockers.
@brzezi How can I use your code with the plugin? Can you give a more detailed example?
With this snap of code you dont need plugin, just add that function fbShare as javascript function somewhere on your page or in js file, then in onClick event you can call fbShare('http://some.url.to.share.com');
How can I share a photo with the facebookClient? Is there a similar command like the publish, but for sharing?