Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
facebook share
var Share = {};
Share.fb = function (link, title, sumary, image, winWidth, winHeight) {
var shareUrl = 'https://www.facebook.com/dialog/feed?';
shareUrl += 'app_id=141676832590601';
shareUrl += '&link=' + encodeURIComponent(link);
shareUrl += '&picture=' + encodeURIComponent(image);
shareUrl += '&name=' + title;
shareUrl += '&caption=' + "";
shareUrl += '&description=' + sumary;
shareUrl += '&display=popup';
shareUrl += '&redirect_uri=' + encodeURIComponent('http://www.facebook.com/dealextremefans');
if (!winWidth)
winWidth = 400;
if (!winHeight)
winHeight = 300;
var winTop = (screen.height / 2) - (winHeight / 2);
var winLeft = (screen.width / 2) - (winWidth / 2);
window.open(shareUrl, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment