Dynamic content for twitter button

Dynamic content for twitter button
0.0 0

#1

Hi everyone - I am really struggling with getting the tweet button on my random quote machine to populate a tweet with the randomly generated quote.

Have tried updating the button’s attribute with jQuery but haven’t been successful. I understnad that it might have something to do with all the scripts in my head loading before I updated the button but don’t understand how to work around this.

Here is my codepen: https://codepen.io/lucylikescode/full/aGmGVV

Would appreciate some pointers on this!


#2

Think you should use something like https://twitter.com/intent/tweet?text=' ...... instead of share


#3

Hey Sorin - Thanks for the tip! Did update the href to /intent/tweet instead of /share but not seeing any difference in the behaviour :frowning:


#4

And now it works! Thanks for the tip Sorin - using https://twitter.com/intent/tweet?text= instead of the standard twitter button made things much easier :slight_smile:


#5

Glad you made it working. :+1: