I came across an interesting article at CSSKarma about form designing. The author explains that form labels need not always be outside the input controls. Using jQuery and pinch of CSS, the article focuses on a creative implementation of designing forms, while retaining the intended User Experience. Check out the article…
Tag Archive: jQuery
January 14 marks the birth of jQuery. To celebrate the release of jQuery 1.4 (also on January 14), the jQuery team is bringing fourteen consecutive days of new releases. Each day, they will publish videos, tutorials, code releases and other fun stuff. They have already announced the re-design of the jQuery API site. For more information, about how the new site will help developers embrace one of the most popular JavaScript frameworks, click here.
The event also focuses on sharing videos and tutorials detailing the awesome features of jQuery 1.4. To ensure you don’t miss out on any of the goodies, subscribe to the email/rss feed or visit the site.
I have been using jQuery in most of my projects and am quite excited about the new release. Aren’t you?
This post explains self-executing functions and its benefits. So lets started by breaking down a normal function and converting it into one …
var myVar = "This is a normal function...";
function ShowAlert(textToAlert)
{
alert(textToAlert);
}
ShowAlert(myVar);
We all know that functions are also objects in JavaScript. Thus they can be evaluated using the eval() function and also in the case of setInterval() function you can pass the name of the function as an object. Thus like other objects, we can also use grouping operators like ( and ).
var myVar = "This is still a normal function...";
function ShowAlert(textToAlert)
{
alert(textToAlert);
}
(ShowAlert)(myVar);
We are halfway there. Lets replace the name of the function with the function definition and make it a single statement.
var myVar = "This is a self-executing function...";
(function ShowAlert(textToAlert)
{
alert(textToAlert);
})(myVar);
Ok. So far so good. Since we are going to run this function as soon as we create it, it doesn’t need a name. Next step is to make this function an anonymous function.
var myVar = "This is an anonymous self-executing function...";
(function (textToAlert)
{
alert(textToAlert);
})(myVar);
And voila… We have created a self-executing anonymous function.
Although in this example, the advantage might not be obvious, but in real-world, this technique is quite helpful as it encapsulates the functionality and also prevents the cluttering of the global namespace. If you take a peek at the jQuery source code, you will notice that the whole library is wrapped in a single, self-executing function that is assigned to the jQuery global object. It’s precisely the reason that jQuery doesn’t pollute the global namespace nearly as much as other libraries.
Woork author Antonia Lupetti has recently released a visual cheat sheet for jQuery 1.3. The cheat sheet having six pages is a helpful reference containing the complete API reference with descriptions and sample code.
What I like most about this cheat sheet, is it’s simple and elegant design. Kudos to Antonia!
I recently came across a very nice jQuery control library called jQuery Tools. The library features the following JavaScript tools :
- Tabs
- Tooltips
- Expose
- Overlay
- Scrollable
- FlashEmbed
So now you are thinking “Whats so great about this? We already have tons of jQuery plugins for this…”. I thought so too.
The striking advantage of this library is that these tools can be combined, extended and styled, giving you potentially unlimited options for creating customized widgets for your web pages. The website also features great and detailed examples to help you get started, and features some of the best practices recommended by Yahoo engineers. [ref : Best Practices for speeding up your website]





