I am looking at the latest update to Facebook's share button. It seems that it's no longer possible to include a share button in a website without including the Facebook javascript SDK, or having a Facebook app somewhere that provides you with an app id?
Share button example 1 uses the Facebook SDK
FB.ui({
method: 'share',
href: 'https://developers.facebook.com/docs/',
}, function(response){});
Share button example 2 uses a custom app id
https://www.facebook.com/dialog/share?
app_id=145634995501895
&display=popup
&href=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2F
&redirect_uri=https%3A%2F%2Fdevelopers.facebook.com%2Ftools%2Fexplorer
Question: how to build a plain and simple share button for Facebook with one line of code, that does not require libraries and app id's?
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.
you can use facebook sharer link and a simple popup to do the job
$("#facebookShareLink").on("click",function(){ var fbpopup = window.open("https://www.facebook.com/sharer/sharer.php?u=http://stackoverflow.com", "pop", "width=600, height=400, scrollbars=no"); return false; });
It is possible. No need for an FB application for a simple sharing of URL. Create a simple pop up window and use Facebook share dialog.
https://developers.facebook.com/docs/sharing/reference/share-dialog This is still included in their API as of the moment.
window.open("https://www.facebook.com/sharer/sharer.php?u=http://www.gmanetwork.com/news/", "pop", "width=600, height=400, scrollbars=no");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With