I am trying to create a custom tweet button with a popup menu, this part works. However, I cannot get it to place hashtags in the text area.
Tweet content
url=http://www.mywebsite.com&text=mytweetcontent&via=mytwitterusername
In & text =, I experimented using mytweetcontent + # myhashtag, and also tried to encode URL% 23 (which corresponds to #); however, I still cannot get the hashtag. Any ideas on what I can do? I would prefer to have my own image, so I don't use the proprietary jscript twitter button. Many thanks for your help!
Full code for reference:
<a href="javascript:(function(){window.twttr=window.twttr||{};var D=550,A=450,C=screen.height,B=screen.width,H=Math.round((B/2)-(D/2)),G=0,F=document,E;if(C>A){G=Math.round((C/2)-(A/2))}window.twttr.shareWin=window.open('http://twitter.com/share?url=http://www.mywebsite.com&text=%23+mytweetcontent&via=mytwitterusername','','left='+H+',top='+G+',width='+D+',height='+A+',personalbar=0,toolbar=0,scrollbars=1,resizable=1');E=F.createElement('script');E.src='http://platform.twitter.com/widgets.js';F.getElementsByTagName('head')[0].appendChild(E)}());"><img src="twitter-logo.png" border="0"></a>
Edit * Reply to comment
Thanks for the offer! I have not tried with hashtag, just fine, but changing and so on? deletes the content area, code below. The top line is the result in the tweet box, below the corresponding url.
mycontent http://t.co/nKb4nWC via @myusername
http://twitter.com/intent/tweet?text=mycontent&url=http%3A%2F%2Fwww.mywebsite.com&via=myusername
http://t.co/YzrDfzX via @myusername
http://twitter.com/intent/tweet?url=http%3A%2F%2Fwww.mywebsite.com%3Ftext%3Dmycontent&via=myusername