I'm trying to change the data-text on twitter share button with the tutorial in here: DEMO
But, is there any way to automatically click the "new" tweet button after changing the data-text? cause it has to clicked manually to show the share window
I'm trying to change the data-text on twitter share button with the tutorial in here: DEMO
But, is there any way to automatically click the "new" tweet button after changing the data-text? cause it has to clicked manually to show the share window
The Tweet button is in an iframe on another domain, so you won't be able to access it. I also couldn't find any documentation about how to open the window programatically, so here's my hacky solution: just open a popup to
https://twitter.com/intent/tweet
, passing it the necessary parameters in the query string. No need for a tweet button.This should work as desired. Demo.
Popup function from the mighty PPK: http://www.quirksmode.org/js/popup.html