Quote generator - problem making twitter button post quote in twitter status[SOLVED]

I am at a complete loss on this. I have spent hours reading forum posts related to this, but I still have not been able to figure this out. The twitter button opens the twitter page, however I cannot get it to post the quote in the twitter status box. Any help or advice would be greatly appreciated.

Hi, in your HTML make empty link like this ::
<a class="twitter"  href="" target="_blank">
Then using jQuery you can dynamically make link with text ::
 
$(".twitter").click(function(){
      var textToTweet = quote;
      var tweetLink = 'https://twitter.com/intent/tweet?text=' + encodeURIComponent(textToTweet);
      $('.twitter').attr('href',tweetLink).click(); // perform click and post quote
});

This will send tweet to tweeter and fill in proper page on tweeter however it will open a login page, so you can check how to post without logging (maybe just a parameter in link is needed).
Hope it helps !
1 Like

Thank you for your response. For some reason it never occurred to me to to change the html part. It makes complete sense to leave the HTML link blank so the link is done strictly with jQuery.

I tried doing the coding as you had suggested, but I was still having issues. However, your response really helped me to look at it all in a different way. I did end up completely changing my coding in the end and was finally able to make it work.

Thanks again for your response!!