I’d just like to announce the release of DOMAssistant 2.0 by Robert Nyman. For those of you who aren’t DOMAsses, the author describes the library as follows:
The idea of DOMAssistant is to provide a simpler and more consistent way to script against the Document Object Model (DOM) in web browsers. The idea is that everything starts with the element in question, and then performs various methods on it, such as adding/removing classes, finding elements with a certain className, applying events to it, etc.
This new release introduces several cool new features:
- Chainability
-
- Basic Ajax capabilities
- New DOMReady() method to better identify when the DOM is fully loaded
- XPath support
Now, being a jQuery fanatic, I was skeptical of giving this library a try, but I must say that it is actually pretty fun to work with. The chainability added in this newest version makes common tasks very simple, and the code short and easy to understand. Take a look at the following:
// add an onclick event to #element and add the class "class-name"
$("element").addEvent("click", function(){
alert('Thanks for clicking, pally-o!');
}).addClass('class-name');
Another very cool thing about this library is that it’s pretty small. The entire source code for it is only 10k (compressed, but not gzipped), where jQuery is 26kb (compressed, but not gzipped). On top if that, the library is modular. If you aren’t going to use any ajax, you don’t need to bloat up your source with the ajax functions. There are several modules in the library and you are free to pick and choose which you want to use.
Head on over to the DOMAssistant project page and take a look… don’t be a DOMAss.