Hacker News new | ask | show | jobs
by anonym 6579 days ago
I use Dean Edwards's base2. I like it because it is very simple, and because it adheres to standards; that is, rather than creating a map and a forEach of its own, with its own semantics, it implements them according to the Javascript standard (or proposals, don't recall if they have yet been adopted) for browsers that don't yet support them natively (anything but Mozilla, I think). It also cleans up DOM manipulation so that you can use standards-compliant methods and it will work on non-compliant browsers (all the way back to IE5).

Similarly, for DOM querying, it implements the W3 Selectors API rather than reinventing the wheel.

I really like this approach. base2 doesn't provide anything in the way of widgets (though I think there may be some code along these lines in the Subversion repository, implementing some of the HTML5 components) -- for most of what I do, widgets aren't available anyway or would need to be extended, so I end up writing my own. And it's easy enough to use a YUI or other widget with base2 when it makes more sense.

For animation, I've used animation.js and found it simple and fast.

1 comments

Thanks for this. I've been looking for something less bloated than jQuery and Prototype. I like native code, but don't always have time to handle every browser incompatibility.

> anything but Mozilla, I think

WebKit also handles things well:

[].map

function map() { [native code] }

[].forEach

function forEach() { [native code] }