How to dynamically create Twitter’s tweet button and Facebook’s like button!

There are many examples out there in the world of internet, which show how to integrate the tweet button and the like button, but none show how to do it dynamically. In this post I have tried to show how trivial it is to generate tweet and like button dynamically using JavaScript.

jQuery Spotlight Plugin: jSpotlight

About: This plugin allows you to bring spotlight on any HTML element. This plugin may be used in situations where you need to call attention to or highlight where a data value or content has changed within the interface. A particular usage would be when implementing the UI Pattern “One Second Spotlight”. Do note that jQuery in itself has no highlight effect and the animate function does not support color animation or transition. Hence, this plugin aims at adding that

Continue Reading

Javascript method priority queue

Problem Statement: There are times when people are faced with the problem of calling methods in a particular order based on some kind of priority. There are times when you wish to be able to add methods to some kind of a method queue along with the priority. The priority decides which methods is to be called first. Then at some later point, you wish to execute the methods in the queue in order of priority. A case in point

Continue Reading

A useful JavaScript pattern – The Module Pattern

Introduction A good API design forms an integral part of coding best practices. And what is a good API? A good API would only expose methods that would be needed by the client using the API. The public space would not be cluttered by unnecessary methods. And there are not many times where I have seen JavaScript developers really caring about a good API design. The reason probably is that people don’t take JavaScript seriously. Anyway, that is another topic,

Continue Reading

jQuery – Using $ with other JavaScript libraries

Although $ sounds native to jQuery alone, but there are other JavaScript libraries and frameworks as well that use $, one example is scriptaculous. But what if you want to use $ in your jQuery based code or plugin, $ sure is a very short shortcut. I will show you a nice little trick of how to do so. The trick involves writing all the code in a function and executing that function immediately: (function() { // put your code

Continue Reading

Extending jQuery – jQuery plugin development

Some introductory words. jQuery is a very popular JavaScript library and why wouldn’t it be popular, it has made the life of us developers so so easy. Its not just that our lives have become easy, but so has our code-base become more cleaner. Anyways we are not going to discuss the merits of jQuery, I will have a separate post to discuss that. Right now what I would be discussing is how to write plugins for jQuery. Two ways

Continue Reading