Home >Web Front-end >Front-end Q&A >What is a javascript library?
Javascript libraries are also called javascript frameworks. These libraries are produced to adjust the difficult and time-consuming high-level programming of JavaScript; all js frameworks provide functions for common JavaScript tasks, including animation, DOM manipulation and Ajax handling.
The operating environment of this article: windows7 system, javascript version 1.8.5, Dell G3 computer.
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 have emerged.
These JavaScript libraries are often called JavaScript frameworks.
All of these frameworks provide functions for common JavaScript tasks, including animation, DOM manipulation, and Ajax handling.
JavaScript libraries - jQuery, Prototype, MooTools.
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:
Microsoft
IBM
Netflix
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, a large framework that covers a large number of functions Libraries ranging 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
Quote jQuery
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"> </script>
Using Frameworks
Before 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. [Recommended learning:js basic tutorial]
The above is the detailed content of What is a javascript library?. For more information, please follow other related articles on the PHP Chinese website!