CHAPTER 4Libraries

JavaScript libraries have been around in one form or another for almost as long as JavaScript itself. As you go from project to project, it's inevitable that you'll find yourself reusing various functions. They become part of your core that you end up copying each time you start up something new. With any good library, code reuse leads to reliability; using the same code on multiple projects means that the code has been exposed to more and more people, enabling bugs or cross-browser issues to be resolved.

You can, of course, use someone else's library. Using an existing library such as Prototype or jQuery gives you a higher level of reliability that might be difficult to attain through maintaining your own code base.

The trade-off ...

Get Accelerated DOM Scripting with Ajax, APIs, and Libraries now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.