JavaScript library
JavaScript Libraries - jQuery, Prototype, MooTools.
JavaScript Frameworks (Libraries)
Advanced JavaScript programming (especially the complex handling of browser differences) is usually difficult and time-consuming.
To cope with these adjustments, manyJavaScript (helper)libraries have emerged.
These JavaScript libraries are often calledJavaScript frameworks。
In this tutorial, we will learn about some popular JavaScript frameworks:
- jQuery
- Prototype
- MooTools
All these frameworks provide functions for common JavaScript tasks, including animation, DOM manipulation, and Ajax handling.
In this tutorial, you will learn how to get started with them to make JavaScript programming easier, safer, and more enjoyable.
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 also provides a companion UI (User Interface) and plugins.
Many large companies use jQuery on their websites:
- Microsoft
- IBM
- Netflix
To learn jQuery more in-depth, please visit ourjQuery Tutorial。
Prototype
Prototypeis a library that provides a simple API for performing common web tasks.
APIis an abbreviation for Application Programming Interface. It is a library containing properties and methods for manipulating the HTML DOM.
Prototype enhances JavaScript by providing classes and inheritance.
MooTools
MooToolsIt is also a framework that provides an API to make common JavaScript programming simpler.
MooTools also contains some lightweight effects and animation functions.
Other Frameworks
Below are some other frameworks not covered above:
YUI- Yahoo! User Interface Framework, a large library covering many functions, from simple JavaScript features to complete internet widgets.
Ext JS- Customizable widgets for building rich Internet applications.
Dojo- A toolkit for DOM manipulation, events, widgets, etc.
script.aculo.us- An open-source JavaScript framework focused on 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 page size 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 store the framework library in a common location for every web page to share.
CDN (Content Delivery Network) solves this problem. A CDN is a network of servers containing shareable code libraries.
Free CDN resources in China include:
- Staticfile CDN:https://staticfile.net/
Free CDN resources overseas include:
- cdnjs:https://cdnjs.com/
To use a JavaScript framework library in your web page, simply reference the library in the <script> tag:
Referencing jQuery
Using Frameworks
Before you decide to use a JavaScript framework for a web page, 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 are no installation programs.
Usually you just need to reference a library file from the web page.
In the next chapter of this tutorial, we will fully explain the process of testing jQuery.
Other Extensions