Home  >  Article  >  Web Front-end  >  What is a javascript library?

What is a javascript library?

藏色散人
藏色散人Original
2021-04-01 15:39:533599browse

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.

What is a javascript library?

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:

  • Google

  • 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

  • ##Yahoo! YUI

such as To use a JavaScript framework library in your web pages, simply reference the library in the 3f1c4e4b6b16bbbd69b2ee476dc4f83a tag:

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn