I am trying to create a “tweet” button that looks like a proper button (not just the word “tweet” as a hyperlink) that will share the currently displayed text from the page, hashtags, etc. I thought this would be straightforward, but I have read the documentation at least 20 times and I am as confused as ever.
I go to dev.twitter.com, and down the menu on the left, choose “Twitter for Websites”, then “Tweet Button.” According to those instructions, all I have to do is add the “twitter-share-button” class, the href attribute, data-size=“large”, etc., and done.
But if I stop there, I only have the text link, no button. I did include the <script> link to https://platform.twitter.com/widgets.js at the top, right after my bootstrap css and javascript source links. It renders the same in Firefox and Chrome, and I have have never installed ad blocking in Chrome.
I did find, on publish.twitter.com, a markup generator, that looked very promising, and shows you what looks like a template with a proper button and says “here you go, just copy this code and paste it right into your html” but no, it’s the same exact thing as before, and it just gives you the text with hyperlink. Disappointing.
So, then I’m led into the circular labyrinth of “For best performance and reliability, include the widgets.js script in your template.” I’m learning JavaScript, not a professional. I cannot, to save my life, figure out how to use this. Am I supposed to be able to copy and paste this widget code and use it straight out of the box? (I tried, it seems to do nothing.) Do I need to include all the snippets on all of the widgets pages (Setup, Loading and Initialization, Factory Functions, Events)? Is this why the button won’t render? The whole “performance and reliability” part made me think, at first, that it was optional, but maybe it’s not?
At this point, I would be happy to just find an image of a button and use an <img src="twitter.com/tweet.png"> I mean wouldn’t that be so much simpler than all this scripting, since I don’t need any other options right now.
Thanks in advance