WebDevelopment, ColdFusion, Railo, JS, Database and Tech-related by the Co-Founder and CEO of tunesBag.com

Thursday, 13 September 2007

jQuery 1.2 released

Yeasterday a new version of jQuery has been released (1.2). If you ever have to deal with JavaScript in your application in a professional way, give this library a try. It's sooo smooth and I prefer this one very very much over prototype.

So, what's the big deal of this tiny (22kb) little .js file?
The design of the library is just gorgeous. The basic principle is very simple:
  1. Select the desired objects
  2. Perform some action on them
Sounds simple, hmm? The power of the system can be shown in some short example:
In this case an object with the ID this_is_the_id is selected and hidden.

$("#orderedlist > li").addClass("blue");
I this example, the CSS class "blue" is added to all child elements of an ordered list.

$(document).ready(function() {

Here some code can be placed which is executed as soon as the DOM structure of the document has finished loading - so no more onLoad events which can have a huge delay because of e.g. external images or advertising stuff.

Here you can find some more tutorials on this.

Thanks to Ben for his posting about the new release. He also mentions his fear about getting lazy in writing real hardcore JS stuff, but my opinion is goes ahead with the the jQuery credo in this case: Write less, do more!

No comments: