Return to Snippet

Revision: 31314
at September 2, 2010 21:12 by abhayr


Initial Code
<a href="http://twitter.com/home?status=Just read post by @rodneyb about adding tweet this link to website. Read it here - http://bit.ly/3jF3qy"></a>

<script type="text/javascript">
var twtTitle  = document.title;
var twtUrl    = location.href;
var maxLength = 140 - (twtUrl.length + 1);
if (twtTitle.length > maxLength) {
twtTitle = twtTitle.substr(0, (maxLength - 3))+'...';
}
var twtLink = 'http://twitter.com/home?status='+encodeURIComponent(twtTitle + ' ' + twtUrl);
document.write('<a href="'+twtLink+'" target="_blank"'+'><img src="tweetthis.gif"  border="0" alt="Tweet This!" /'+'><'+'/a>');
</script>

Initial URL

                                

Initial Description

                                

Initial Title
Adding tweeter to ur site

Initial Tags

                                

Initial Language
JavaScript