I've been working on adding a share link for my website and I came up with the following code:
function handleFacebook(shortURL) {
$(".facebook").click(function(e) {
e.preventDefault();
window.open(
'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(shortURL),
'facebook-share-dialog',
'width=626,height=436');
return false;
});
});
}
In my HTML (JADE), I have:
div.facebook
img(src="/images/facebook_logo.png")
Unfortunately, this code doesn't work when popups are blocked.
Does anyone know how to solve the popup blocking issue?
I'm not sure what changes need to be made or where to add them. Any suggestions?