C

JavaScript Libraries

JavaScript libraries help to bridge the gap between browser differences and provide easier access to complex browser features. Libraries come in two forms: general and specialty. General JavaScript libraries provide access to common browser functionality and can be used as the basis for a web site or web application. Specialty libraries do only specific things and are intended to be used for only parts of a web site or web application. This appendix provides an overview of these libraries and some of their functionality, along with web sites that you can use as additional resources.

GENERAL LIBRARIES

General JavaScript libraries provide functionality that spans across topics. All general libraries seek to equalize browser interface and implementation differences by wrapping common functionality with new APIs. Some of the APIs look similar to native functionality, whereas others look completely different. General libraries typically provide interaction with the DOM, support for Ajax, and utility methods that aid in common tasks.

Yahoo! User Interface Library (YUI)

Yahoo! User Interface Library (YUI) is an open-source JavaScript and CSS library designed in an à la carte fashion. There isn’t just one file for this library; instead there are multiple files provided in a variety of configurations, ensuring that you load only what you need. YUI covers all aspects of JavaScript, from basic utilities and helper functions to full-blown widgets. YUI has a dedicated team of software engineers at Yahoo! providing excellent documentation and support.

License: BSD License

Web site: www.yuilibrary.com

Prototype

Prototype is an open-source library that provides simple APIs for common web tasks. Originally developed for use in Ruby on Rails, Prototype is class-driven, aiming to provide class definition and inheritance for JavaScript. To that end, Prototype provides a number of classes that encapsulate common and complex functionality into simple API calls. As a single file, Prototype can be dropped into any page with ease. It is written and maintained by Sam Stephenson.

License: MIT License and Creative Commons Attribution-Share Alike 3.0 Unported

Web site: www.prototypejs.org/

The Dojo Toolkit

In the Dojo Toolkit, an open-source library modeled on a package system, groups of functionality are organized into packages that can be loaded on demand. Dojo provides a wide range of options and configurations, covering almost anything you want to do with JavaScript. The Dojo Toolkit was created by Alex Russell and is maintained by the employees and volunteers at the Dojo Foundation.

License: “New” BSD License or Academic Free License version 2.1

Web site: www.dojotoolkit.org/

MooTools

An open-source library designed to be compact and optimized, MooTools adds methods to native JavaScript objects to provide new functionality on familiar interfaces and to provide new objects. Its small size and simple API make MooTools a favorite among web developers.

License: MIT License

Web site: www.mootools.net/

jQuery

jQuery is an open-source library that provides a functional programming interface to JavaScript. It is a complete library whose core is built around using CSS selectors to work with DOM elements. Through call chaining, jQuery code looks more like a narrative description of what should happen rather than JavaScript code. This style of code has become popular among designers and prototypers. jQuery is written and maintained by John Resig.

License: MIT License or General Public License (GPL)

Web site: http://jquery.com/

MochiKit

An open-source library composed of several smaller utilities, MochiKit prides itself on being well-documented and well-tested, having a large amount of API and example documentation and hundreds of tests to ensure quality. MochiKit is written and maintained by Bob Ippolito.

License: MIT License or Academic Free License version 2.1

Web site: www.mochikit.com/

Underscore.js

While not strictly a general library, Underscore.js does provide some additional functionality for functional programming in JavaScript. The documentation talks about Underscore.js as a complement to jQuery, providing additional low-level functionality for working with objects, arrays, functions, and other JavaScript data types. Underscore.js is maintained by Jeremy Ashkenas of DocumentCloud.

License: MIT License

Web site: http://documentcloud.github.com/underscore/

INTERNET APPLICATIONS

Internet application libraries are designed to ease the development of an entire web application. Instead of providing small pieces to the application puzzle, they provide entire conceptual frameworks for rapid application development. Though these libraries may contain some low-level functionality, their goal is to help you develop web applications quickly.

Backbone.js

A minimal model-view-controller (MVC) open-source library built on top of Underscore.js, Backbone.js is optimized for single-page applications, allowing you to easily update parts of the page as application state changes. Backbone.js is maintained by Jeremy Ashkenas of DocumentCloud.

License: MIT License

Web site: http://documentcloud.github.com/backbone/

Rico

An open-source library that aims to make rich Internet-application development easier, Rico provides utilities for Ajax, animations, and styles and widgets. The library is maintained by a small team of volunteers, and development has slowed significantly as of 2008.

License: Apache License version 2.0

Web site: http://openrico.org/

qooxdoo

qooxdoo is an open-source library that aims to help with the entire web-application development cycle. qooxdoo implements its own versions of classes and interfaces to create a programming model similar to traditional object-oriented (OO) languages. The library includes a full GUI toolkit and compilers for simplifying the front-end build process. qooxdoo began as an internal library for the 1&1 web-hosting company (www.1and1.com) and later was released under an open-source license. 1&1 employs several full-time developers to maintain and develop the library.

License: GNU Lesser General Public License (LGPL) or Eclipse Public License (EPL)

Web site: www.qooxdoo.org/

ANIMATION AND EFFECTS

Animation and other visual effects have become a big part of web development. Getting smooth animation out of web pages is a nontrivial task, and several library developers have stepped up to provide easy-to-use and smooth animation and effects. Many of the general JavaScript libraries mentioned previously also feature animation.

script.aculo.us

A companion to Prototype, script.aculo.us provides easy access to cool animations using nothing more than CSS and the DOM. Prototype must be loaded before script.aculo.us can be used. script.aculo.us is one of the most popular effects libraries, being used by major web sites and web applications around the world. The author, Thomas Fuchs, actively maintains script.aculo.us.

License: MIT License

Web site: http://script.aculo.us/

moo.fx

The moo.fx open-source animation library is designed to work on top of either Prototype or MooTools. Its goal is to be as small as possible (the latest version is 3KB) and to allow developers to create animations while writing as little code as necessary. moo.fx is included with MooTools by default; it can also be downloaded separately for use with Prototype.

License: MIT License

Web site: http://moofx.mad4milk.net/

Lightbox

Lightbox, a JavaScript library for creating simple image overlays on any page, requires both Prototype and script.aculo.us to create its visual effects. The basic idea is to allow users to view an image or a series of images in an overlay without leaving the current page. The “lightbox” overlay is customizable in both appearance and transitions. Lightbox is developed and maintained by Lokesh Dhakar.

License: Creative Commons Attribution 2.5 License

Web site: www.huddletogether.com/projects/lightbox2/

CRYPTOGRAPHY

As Ajax applications became more popular, there was an increasing need for cryptography on the browser to secure communications. Fortunately, several people have implemented common security algorithms in JavaScript. Most of these libraries aren’t officially supported by their authors but are used widely nonetheless.

JavaScript MD5

JavaScript MD5 is an open-source library that implements MD4, MD5, and SHA-1 secure hash functions. Author Paul Johnston and several other contributors have written this extensive library, one file per algorithm, for use in web applications. The home page gives an overview of hash functions and a brief discussion about vulnerabilities and appropriate uses.

License: BSD License

Web site: http://pajhome.org.uk/crypt/md5/

JavaScrypt

The JavaScrypt library implements MD5 and AES (256-bit) cryptography. JavaScrypt’s web site offers lots of information about the history of cryptography and its usage in computers. Though lacking basic documentation about integrating the library into your web application, JavaScrypt’s source code is full of advanced mathematical manipulations and computations.

License: Public domain

Web site: www.fourmilab.ch/javascrypt/

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.43.26