Adding a mention to Tweet Button



I used the Twitter API on my website to get the followers of a user and display their thumbnails. When I click a thumbnail, the clicked user screen_name is stored in a javascript variable (followerClicked). What I want to do is create a tweet button that has as default text my variable followerClicked, so that I can mention the follower I selected. (I want to do this because the web intent doesn’t show me the autocomplete dropdown and I have to give my users the ability to select a follower to mention)

The first part ( connecting to the API and getting the followers) works just fine. The problem begins when I try to add my variable to the web intent. I tried to insert it in the attribute “data-related” or “data-text”. When I printed this attributes to console, everything was fine. The arguments had my variable as value. But when I created the tweet button it keeps having my page title as default text.

¿How can I get this done?
It doesn’t work when I create an tag and change the text attr either



What is the value of followersList when you’re trying to accomplish this?

If you were trying to mention users @abc and @xyz, i would expect the result of the whole URL to appear as:

The %40s are the “@” symbols for each user mentioned. The %20s are space characters to separate the mentions from other text. You could use “+” characters instead of %20 if you wanted to in this case.