Last active
December 14, 2021 07:19
-
-
Save juanbrujo/111d6f5b95fc6a33236e to your computer and use it in GitHub Desktop.
lightweight share buttons with vanilla javascript
If I use this, it works perfectly:
<a href="https://www.facebook.com/sharer/sharer.php?u=https://www.mysite.com/blog/test.html" class="facebook share">
Facebook</a>
But if I use this, the pop-up opens, but the link doesn't load in the new window. It just opens an "about:blank" pop-up window:
<a href="https://www.facebook.com/sharer/sharer.php?u=https://www.mysite.com/blog/test.html" class="facebook share">
<img src="/static/images/facebook-share.png" width="64px"></a>
Thank you!
Bro, they solved it on SO. Here's the link if you're interested: https://stackoverflow.com/questions/69775905/js-wont-catch-a-link-if-there-is-an-image-in-the-anchor-tag
Thank you for the code!! Keeping the website light =)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
paste some code to check your HTML please