JavaScript library, JavaScript
JavaScript library-jQuery, Prototype, and MooTools.
JavaScript framework (Library)
JavaScript advanced programming (especially complex processing of browser differences) is usually difficult and time-consuming.
To cope with these adjustments, manyJavaScript (helper)Library came into being.
These JavaScript libraries are often calledJavaScript framework.
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 operations, and Ajax processing.
In this tutorial, you will 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 the CSS selector to access and operate HTML elements (DOM objects) on the webpage ).
JQuery also provides companion UI (User Interface) and plug-ins.
Many large companies use jQuery on their websites:
- Google
- Microsoft
- IBM
- Netflix
To learn more about jQuery, visit our jQuery tutorial.
Prototype
PrototypeIs a library that provides simple APIs for executing common web tasks.
APIIs the abbreviation of Application Programming Interface. It is a library containing attributes and methods and is used to operate html dom.
Prototype enhances JavaScript by providing classes and inheritance.
MooTools
MooToolsIt is also a framework that provides APIs that make common JavaScript programming easier.
MooTools also contains some lightweight effects and animation functions.
Other frameworks
The following are some other frameworks not covered above:
YUI-Yahoo! The User Interface Framework covers a large library of a large number of functions, from simple JavaScript Functions to complete internet widgets.
Ext JS-Customizable widgets for building rich Internet applications ).
Dojo-Toolkit for DOM operations, events, widgets, etc.
Script. aculo. us-Open-source JavaScript framework for Visual Effects and interface behavior.
UIZE-Widgets, AJAX, DOM, templates, and so on.
CDN-Content Delivery Network
You always want the webpage to be as fast as possible. You want the page capacity 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 place the framework inventory in a common location for each web page to share.
CDN (Content Delivery Network) solves this problem. CDN is a server network that includes sharable code libraries.
Google provides a free CDN for a series of JavaScript libraries, including:
- JQuery
- Prototype
- MooTools
- Dojo
- Yahoo! YUI
However, Google is often blocked by GFW in China, short for Great Firewall (GFW), which causes unstable access, we recommend that you use the public library of Baidu static resources: http://cdn.code.baidu.com /.
To use the JavaScript Framework library on your webpage, you only need to reference the library in the <script> tag:
Reference jQuery
<Script src = "http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js">
</Script>
Framework
Before you decide to use a JavaScript framework for a webpage, it is wise to test the framework first.
JavaScript frameworks are easy to test. You do not need to install them on your computer, nor have they installed programs.
Generally, you only need to reference a library file from the web page.
In the next chapter of this tutorial, we will explain the jQuery testing process completely.