4 ms·
> no JavaScript Not to knock an otherwise nice site (CTRL & + improves readability for me personally, though), but: (function(d, s, id) { var js, fj
by Tech-Noir 9y ago
> no JavaScript
Not to knock an otherwise nice site (CTRL & + improves readability for me personally, though), but:
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk.js#blahblahblah';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
AFAIK, even for sites that want to feed the monster, that's unnecessary:
http://chrisltd.com/blog/2015/04/social-share-like-buttons-without-javascript/ http://chrisltd.com/blog/2015/04/social-share-like-buttons-w...
https://sharingbuttons.io/ https://sharingbuttons.io/
- kbenson 9y agoSo I decided to test the christld ones: Twitter seems to work (brings up form). Facebook redirects to an error. Linkedin seems to work (brings up form when logged in). Pinterest seems to work (brought up create board dialog when logged in) Google+ seems to work (brings up share form). I do have to say that for me that these would actually work and the JS likely wouldn't in some cases, since I make heavy use of Firefox's containers now to sandbox a lot of online identities, and just have new windows for certain URLs automatically load in the correct container.
- Tech-Noir 9y agoThanks, that's interesting. The chrisltd blog is from 2015, so I did wonder if some of it might be out of date by now. AFAICS (which I didn't notice at first) sharingbuttons has a slightly different FB URL, which may not give an error: https://facebook.com/sharer/sharer.php?u=YOUR-URL https://facebook.com/sharer/sharer.php?u=YOUR-URL Compared to chrisltd's: https://facebook.com/sharer.php?u=YOUR-URL https://facebook.com/sharer.php?u=YOUR-URL