JSFiddle - React, Tailwind, and code Playground
by arcm111
HTML
<div id="dialog" title="Facebook"></div>
JavaScript
function fbs_click(width, height) {
var leftPosition, topPosition;
leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
topPosition = (window.screen.height / 2) - ((height / 2) + 50);
var windowFeatures = "status=no,height=" + height + ",width=" + width + ",resizable=yes,left=" + leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY=" + topPosition + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no";
var u = location.href,
t = document.title,
href = 'http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t);
$('#dialog').html('<a href="' + href + '">Share with Facebook</a>').dialog({
'height': height,
'width': width
});
}
fbs_click(300, 100);