Skip navigation.

Pimpin' Validation Summary With CSSAll recent postsAlways Set The Source of IFrame Content (iframe.src)

Choosing a JavaScript Toolkit For Serious DOM Manipulation

It has finally become clear to me that you can’t get by solely with the MS AJAX Library for sophisticated DOM manipulation. The plumbing is impressive: classes, namespaces, interfaces, enums, etc. However, the Sys.UI.DomElement class doesn’t get you very far. Writing own code to traverse and manipulate DOM gets very boring very fast and is very unproductive.

The AJAX Control Toolkit Common Library

The toolkit relies on a top-notch library full of DOM manipulation goodness. You can find it in AjaxControlToolkit\Common\Common.js. However, it seems to have been written on the go, with functionality put in as needed by involved developers. I may be wrong in my assumption, but I don’t understand why many essential primitives found in other libraries of the same caliber (Prototype, JQuery, Mootools, etc) are missing. Also, common.js doesn’t appear to have been written to be used on its own, but with control extenders only.

JQuery

Once it got tedious to plug holes of the mentioned libraries and write the same code over and over, I decided to look around for a comprehensive library. The usual suspects are Prototype, JQuery, Mootools, and Dojo. I bet you can list a handful more (suggestions?). My goal was to use the MS AJAX Library for plumbing and a toolkit for heavy DOM lifting.

Dojo was disqualified right away. I’m not touching anything ver < 1.0. Even though I used to like Prototype a lot, I dislike its object extension model. I actually like Microsoft’s approach much better.

Mootools is very solid but its DOM querying and traversing capabilities are not up to par with JQuery.

Which leaves JQuery by John Resig. JQuery lets you get away with some pretty insane syntax which surpasses other toolkits, AFAIK. I’ve been able to compress many, many lines of code into one-liners. Also, the community around JQuery has produced a bevy of plugins for all kinds of occasions. The one plugin I like in particular is Interface.

What do you, guys, use?

Comments

Comment permalink 1 Guy |
i would have to agree with you on that.

ive tried most of them and jQuery is clearly the most fitting for me.

Im currently building a boilerplate for my web projects that makes heavy use of both jQuery and asp.net ajax. Im really enjoying it (so far) :-)
Comment permalink 2 Rory Fitzpatrick |
Same setup here, I like the MS Ajax server-side integration and easy web services but when it comes to the user interface its jQuery all the way.
Comment permalink 3 C-J Berg |
jQuery is the way to go! I'm using it all the time, and I only reluctantly use the MS AJAX library when I absolutely need to (jQuery-independent code).

jQuery is very fluent, easy to extend, and fast (especially since 1.1.3.x). It has a lot of well-written plug-ins available. It's a no-brainer folks!
Comment permalink 4 Todd Price |
I've been using mootools with the CNET extensions, and it's been extremely useful. I haven't tried JQuery yet, but will have to take a look at it given everyone's endorsements of it. The think I love about mootools is the easing equations by Robert Penner, which if I understand correctly are what the Flash community has been using for a while. It makes transitions and effects look just like Flash. Does JQuery have something similar, or have the equations been ported to that framework?
Comment permalink 5 Milan Negovan |
Animation in JQuery is quite basic, but it's ok. The Interface plug-in provides some transitions and visual effects, though.
Comment permalink 6 Rob Cherny |
Hey Milan, here at work and on all my personal stuff, I'm a jQuery fan. I think the more you dig into it, the more you'll like it even. It's getting better every day with the friendly competition between libraries on Selector speed and very powerful, not to mention size-conscious. Also allows for very short, very simple scripts to do things which are more often than not very redundant and bloated tasks.
Comment permalink 7 Brent O'Connor |
I've been using prototype and scriptaculous for awhile now but have been looking into JQuery. I tried a JQuery based slideshow and it ended up not working in Safari.
Comment permalink 8 Mohamed Rashed |
Unfortnatly mootools not working with ASP.NEt AJAX, i hope JQuary has no problems with it.
another thing anybody try www.extjs.com/ ??
Comment permalink 9 Shane Shepherd |
Has anyone experimented with the Yahoo! User Interface Library (YUI)? I haven't tried it, but it looks promising...and it appears to be pretty modular. It's a lot more than a Javascript Toolkit.
Comment permalink 10 Ed |
Can you use the minified/compressed version out of the box in IIS6 and IIS7?
Comment permalink 11 Milan Negovan |
Ed, I don't think it matters if it's II6 or 7. Minified scrips are "simply" crunched code which any browser understands. Ditto for compressed scripts---modern browsers know how to unpack compressed content.

Take a look at this post to decide on size vs performance.

Emails and Notifications

Would you like to be notified when somebody responds to this post?  Would you like to have these comments emailed to you?

TrackBacks

Sorry, TrackBacks are not allowed.

Submit your comment

Please enter only text since all HTML tags except hyperlinks will be stripped. Hyperlinks will become live links. Any comments with flaming or offensive language will be deleted. Be courteous to other posters. Thank you.

Your name (required):
Your email (optional):
Your site's URL (optional):
Enter this number
Type in the number above:
Comment (required):