When I was building StyleFeeder, I took the opportunity to survey the various Ajax toolkits out there with the hope of finding one that would suit all of my needs. Needless to say, I didn’t find one that could do everything. But I did learn a few things that I’ve been meaning to share.
alert('Sorry, but your buggy, crash-prone\npiece of junk misnamed a browser\ncrashes on this simple script, believe it or not.\nTherefore I disabled it.');
top.location.href = parent.content.location.href;
By far, prototype.js is the most stable thing out there. In fact, many toolkits require it as a dependency. It’s got a bunch of convenience methods and also forms the basis for easy DOM updating that we expect to see in Ajax applications. The documentation is sparse, but there’s a great start here available here.
I like OpenRico. It’s well documented and quite complete. I especially like the extension to the
XML payload that prototype.js uses. This makes it very easy to update multiple parts of your web page with one response. However, OpenRico’s support for Safari is scant and I’m only using it for it’s rounded-corners support at this time. At one point, I got so sick of Rico’s finnicky behaviour for these rounded corners that I tried using MochiKit instead. I reverted back to Rico because MochiKit was screwing up my CSS layout. Well, maybe it was me. I really don’t know. But it was too much effort just for the sake of a few corners, so I ditched it. It’s worth looking at, though.
Script.aculo.us has a bunch of really neat effects that allow you to slide DIVs around, fade them out, etc. It’s been pretty good across browsers in my experience.
One thing that I tried to avoid as a design goal was toolkits that are tightly coupled to whatever I’m running on the server side. My feeling is that these types of toolkits will evolve in the most stable way over time since they’re not tied to the success of something on the server as well. I don’t mind a bit of “support,” but tight-coupling is just a Bad Thing in my camp.
I highly recommend this approach for those of you who are thinking about building Ajax endpoints using Struts or Spring. Investigate it and I’m confident that you’ll find some compelling stuff in Flow and Cocoon.
You know what NIH means, right?