Hello,
I am trying to interact with Twitter via JavaScript. I want to pass a pre-set message to a user's Twitter status page when they click a link. In an attempt to do this, I have a link defined as follows:
<a href="#" onclick="updateTwitterStatus();">Update Status</a>
<script type="text/javascript">
function updateTwitterStatus() {
var message = "This is a status update";
var url = "http://www.twitter.com/home?status=" + escape(message);
window.open(url, "_blank");
}
</script>
When I execute this code, I get an encoded message. That shows up like this: This%20is%20a%20status%20update
I have tried decodeUriComponent and encodeUriComponent, but nothing seems to be working. What am I doing wrong?