Quote Machine: I cant inflate the tweet url data-text

Quote Machine: I cant inflate the tweet url data-text
0

#1

For some reason I cannot get it to pick up the text values from the API source when I use the attr function to change the tweet URL data-text value.When I click the tweet button all I got is a new tweet window with the hardcoded text. My intention is to set the quote + author in the text field. Any ideas to make it work? I did a lot of research and experimentation with the tweet event binds but no success


#2

I don’t think it’s possible to use the Twitter widget for this, because it runs when the page is loaded, so when you change a quote, there’s no way to update the Twitter button. It’s easy to make your own button though. Just have a link to https://twitter.com/intent/tweet?text=YOUR_TEXT and replace the “YOUR_TEXT” with the new quote when the “Quote Me” button is pressed. Use Font Awesome to give it the Twitter logo.


#3

You can try replacing the link’s href attribute instead with
https://twitter.com/intent/tweet?text=<tweet_content>.
every time you change quotes.


#4

ty guys, now its working!