Section II.5. Using Third-Party APIs and Frameworks


II.5. Using Third-Party APIs and Frameworks

For nearly every cross-browser need, you can probably unearth dozens of JavaScript libraries, APIs, and frameworks available on the Internet. Many of them are free, while some have licensing fees. These libraries generally come into being because their authors either didn't like the way existing libraries worked, or they developed them in response to specific projects they were working on.

Third-party libraries can offer some genuine benefits. Most notably, the popular ones have likely been tested extensively against a wider range of browsers than you normally use. If you don't have access to a Macintosh, for example, it's comforting to use code that has supposedly been vetted against Safari. The same goes for earlier versions of Internet Explorer for Windows if you don't have extra PCs lying around that have a few previous versions installed for testing purposes.

On the downside, however, it's not uncommon for such libraries to be overweight in the code department. A library that promises to deliver the world will likely have a ton of routines that you don't need for a particular job. Additionally, some libraries are built using advanced scripting techniques that may make it difficult for you to dissect the code, in case you wish to trim its size or extract only a handful of routines. Some of the libraries designed with heavy object orientation rely on complex interactions of abstract objects that may not be easy to grasp at the code level if you're not yet a scripting wizard. This could spell trouble in the future if the library is no longer supported (its author has moved on to other things) and you can't figure out how to fix it against changes in future browser versions.

If you choose to go with third-party libraries (including the handful of API routines in this book), make sure you understand how they work from the inside out. That way you can trim or extend them to fit the specific needs of your projects.




Dynamic HTML. The Definitive Reference
Dynamic HTML: The Definitive Reference
ISBN: 0596527403
EAN: 2147483647
Year: 2004
Pages: 120
Authors: Danny Goodman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net