jQuery Improvements

23:59 Fri 13 Jun 2008. Updated: 07:40 14 Jun 2008
[, , ]

Recently I’ve been noticing once again how useful jQuery is, and wondering how I ever did DOM manipulation without it. It’s been a while since I’ve really looked at the release notes, but the latest version (1.2.6) has some significant improvements in it.

They’ve speeded up event handling a great deal, and they’ve also moved the dimensions plugin to the core, so it now supports determining element sizing—something I remember being a tremendous pain in the bad old days.

Incidentally, a while ago John Resig added a color animation plugin that does proper color cycling, something I recall having trouble finding in the past.

Lastly, while looking around this stuff, I came across a convention for jQuery coding that I like a lot: prepending “$” to variables that contain jQuery objects, so that it’s clear whether or not they have jQuery functions and properties. For example:

var $paras = $("p");
var firstPara = $("p")[0];
« (previous)
(next) »

Leave a Reply