How create a Facebook share button without SDK or custom app id?

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");

Create function who will center the pop-up every time.

function openURLInPopup(url, width, height, name) {
    if (typeof(width) == "undefined") {
        width = 800;
        height = 600;
    }
    if (typeof(height) == "undefined") {
        height = 600;
    }
    popup(url, name || 'window' + Math.floor(Math.random() * 10000 + 1), width, height, 'menubar=0,location=0,toolbar=0,status=0,scrollbars=1');
}

Then your link should look like this For Twitter:

 <a class="btn_twitter" onclick="openURLInPopup('http://twitter.com/home?status=http://www.domain.ro/url.html',600, 400); return false;" href="#" target="_blank">Twitter</a>

For facebook:

<a class="btn_fb" onclick="openURLInPopup('http://www.facebook.com/sharer.php?u=http://www.domain.ro/url.html',600, 400); return false;" href="#" target="_blank">Facebook</a>

For Google

<a class="btn_gplus" onclick="openURLInPopup('https://plus.google.com/share?url=http://www.domain.ro/url.html',600, 400); return false;" href="#">gplus</a>

Tags:

Facebook