Skip to content

Instantly share code, notes, and snippets.

@AntoscencoVladimir
AntoscencoVladimir / facebook.html
Created January 10, 2017 02:50
Create facebook share button without SDK app
<script>
function fbShare(siteUrl, picture, title, caption, descr, winWidth, winHeight) {
var winTop = (screen.height / 2) - (winHeight / 2);
var winLeft = (screen.width / 2) - (winWidth / 2);
window.open('http://www.facebook.com/sharer.php?s=100&u=' + siteUrl + '&picture=' + picture + '&title=' + title + '&caption=' + caption , '&description=' + descr, 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
}
</script>