I’d heard a number of people mention various different javascript libraries recently. Seeing a discussion panel talking over the pros and cons of using libraries, and the main ones in development finally prompted me to have a nose around a couple. In particular Simon Willison was promoting the work that Yahoo have been doing recently in publishing a free, open source library that they use internally to build the various Yahoo sites and applications.
I have to say I’m seriously impressed with the work they have done. A lot of the ideas are pretty simple, but the kind of thing that you write from scratch on each project when it’s needed. However, in this case it’s had a load of development and cross browser testing effort thrown at it.
Some of the methods on their DOM object are extremely useful – things like getting the viewport dimensions, or getElementsByClassName. In addition, the library that covers event handling provides a number of very practical features that you could start using immediately.
I am naturally a little sceptical about this kind of thing – I think it’s very important to understand the core technologies that a framework is based on. However these libraries provide the kind of work that you would code yourself, but in a tidy, useable, documented package.
There will be a slight hit on bandwidth, but the library is split into different modules, so you should be able to take what you need without too much extra.
I’ll certainly consider using this on future projects.