If you’ve ever wanted to include a ‘Tweet’ button or link but didn’t want to use the popular Tweet Button code from Twitter (it uses a remote javascript function), there is an alternate approved method called “Intents”. This function works great for instances when simple HTML is preferred (emails, pages geared toward older or simple browsers, etc.). However it doesn’t provide extras like showing how many have used the button or creating the image automatically. So how does it work?
Using Twitter’s Web Intents, you can create links like below:
<a href="http://twitter.com/intent/tweet?url=http://chrisbitting.com &text=Checkout this awesome blog.&via=chrisbitting&hashtags=twitter" title="Tweet" target="_blank">Tweet</a>
Which looks like: Tweet
No Javascript!
Be sure to check the documentation for more options and details: https://dev.twitter.com/docs/intents
Remember when uploading a file via
Adding and setting a cookie via javascript is pretty simple. Sometimes you want the cookie to expire in a certain amount of time, below is the method is use to calculate an expiration: