25 Ways to improve jQuery
Jon Hobbs-Smith has written an excellent article on 25 ways to improve your jQuery. It’s a quite well-written list of tips and tricks.
It’s not written for super-advanced users, nor beginners, rather intermediate users. So you won’t find entry-level tips here, nor will you find advanced explanations on why you should enclose items, or the fastest way to render something to the DOM. It’s a series of real-life, useful, in-the-trenches-kind of tips.
My favorite tip so far is tip #23: Add a JS class to your HTML attribute. By adding a class to your HTML attribute on the javascript load, you get a CSS declarator that is valid only if JS is turned on, which allows you a very easy way to hide things if JS is turned off.
$(‘HTML’).addClass(‘JS’);
Very slick.
The entire article is worth reading, and worth bookmarking. Nicely done.