How to Get Spaces out of Your “Tweet This” Status Links
So, I’ve had woes trying to figure out a way to “Tweet This” using straight HTML. Well, that’s simple, you just add “home?status=” to the end of the twitter link and it’ll put the code in your status input box.
But, if you put a bunch of spaces in there, you’ll get %20 and a host of other unescaped text. That’s not good. So… here’s what I could figure out on this.
You need to escape your href links for any run-of-the-mill <a tag> hrefs you use to point people back to their own status updates with (was that a run-on or what?).
Otherwise, you get lots of %20 signs for spaces in the status box. I tried countless things and finally got this to work.
Escaping Your “Link to Twitter” Href Links
Your HTML code will look like this:
<a href=”#” onClick=”location=’http://m.twitter.com/home?status=’ + escape(‘Point your browser here to learn how to Tweet This from any plain old HTML link: http://bit.ly/14vRN2” />Tweet This</a>
Remember that you should put your own code in the escaped text.