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

Youtube batch processing – less costly requests

The need: YouTube is a very popular video hosting service as everyone knows. And there are many others like me who use this service to host videos. Then when needed these videos are searched based on user request and different levels of information are displayed. While this seems to be a trivial task and yes YouTube has a very nice API with all the functionality needed right there, and the documentation is really very comprehensive. On a side note I

Continue Reading