JavaScript library
JavaScript libraries - jQuery, Prototype, MooTools.
JavaScript Frameworks (Libraries)
JavaScript Advanced programming (especially complex handling of browser differences) is often difficult and time-consuming.
In order to cope with these adjustments, many JavaScript (helper) libraries came into being.
These JavaScript libraries are often called JavaScript frameworks.
In this tutorial, we will learn about some popular JavaScript frameworks:
jQuery
Prototype
MooTools
All of these frameworks provide functions for common JavaScript tasks, including animation, DOM manipulation, and Ajax handling.
In this tutorial, you'll learn how to start using them to make JavaScript programming easier, safer, and more fun.
jQuery
jQuery is currently the most popular JavaScript framework.
It uses CSS selectors to access and manipulate HTML elements (DOM objects) on web pages.
jQuery provides both companion UI (user interface) and plug-ins.
Many big companies use jQuery on their websites:
Google
Microsoft
-
IBM
NETFLIX
To learn jQuery in more depth, visit our jQuery tutorials.
Prototype
Prototype is a library that provides a simple API for performing common web tasks.
API is the abbreviation of Application Programming Interface. It is a library of properties and methods for manipulating the HTML DOM.
Prototype enhances JavaScript by providing classes and inheritance.
MooTools
MooTools is also a framework that provides an API that makes common JavaScript programming easier.
MooTools also contains some lightweight effects and animation functions.
Other Frameworks
Here are some other frameworks not covered above:
YUI - Yahoo! User Interface Framework, covers a lot A large library of functions, from simple JavaScript functions to complete internet widgets.
Ext JS - Customizable widgets for building rich Internet applications.
Dojo - Toolkit for DOM manipulation, events, widgets, and more.
script.aculo.us - Open source JavaScript framework for visual effects and interface behavior.
UIZE - Widgets, AJAX, DOM, templates and more.
CDN - Content Delivery Network
You always want your web pages to be as fast as possible. You want the size of the page to be as small as possible, and you want the browser to cache as much as possible.
If many different websites use the same JavaScript framework, it makes sense to put the framework library in a common location for each web page to share.
CDN (Content Delivery Network) solves this problem. A CDN is a network of servers containing a shareable code base.
Google provides a free CDN for a range of JavaScript libraries, including:
jQuery
Prototype
MooTools
Dojo
- ##Yahoo! YUI
http://cdn .code.baidu.com/.
To use a JavaScript framework library in your web pages, simply reference the library in the <script> tag:Using FrameworksBefore you decide to use a JavaScript framework for your web pages, it is wise to test the framework first. JavaScript frameworks are easy to test. You don't need to install them on your computer, and there is no installer. Usually you only need to reference a library file from the web page. In the next chapter of this tutorial, we will give you a complete explanation of the jQuery testing process.