This problem has happened to me while doing my Random Quote Machine project in CodeCamp. I have tried things related to the data-text attribute but didn`t work.
'https://twitter.com/intent/tweet?hashtags=ilovehashtags&text=' + ...
If you are using the twitter api, meaning including the asynchronus twitter-widget script and such per the api documentation then I’d like to say i have an answer but i dont yet. I am stuck on the same thing doing it this way. So if i eventually find an answer I will let you know…