Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the libraries in javascript

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article focuses on "what are the libraries in javascript". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the libraries in javascript"?

JavaScript library

JavaScript libraries-jQuery, Prototype (prototype), MooTools.

JavaScript framework (library):

JavaScript advanced programming, especially the complex handling of browser differences, is often difficult and time-consuming.

In order to cope with these adjustments, many JavaScript (helper) libraries emerge as the times require.

These JavaScript libraries are often referred to as 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 processing.

JQuery:

JQuery is currently the most popular JavaScript framework.

Http://www.iis7.com/a/lm/yczmljgj/

It uses a CSS selector to access and manipulate HTML elements (DOM objects) on a web page.

JQuery provides both companion UI (user interface) and plug-ins.

Prototype:

Prototype is a library that provides a simple API for performing common web tasks.

API is an abbreviation for Application programming Interface (Application Programming Interface). It is a library containing properties and methods for manipulating HTML DOM.

Prototype implements enhancements to JavaScript by providing classes and inheritance.

MooTools:

MooTools is also a framework that provides API that makes common JavaScript programming easier.

MooTools also contains some lightweight effects and animation functions.

Other frameworks:

Here are the other frameworks:

YUI:Yahoo! User Interface Framework, a large library covering a large number of functions, from simple JavaScript functions to complete internet widget.

Ext JS: customizable widget for building rich Internet applications (rich Internet applications).

Dojo: a toolkit for DOM operations, events, widget, and so on.

Script.aculo.us: an open source JavaScript framework for visual effects and interface behavior.

UIZE:Widget, AJAX, DOM, templates, etc.

CDN-content delivery Network:

You always want the web page 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 sites use the same JavaScript framework, it makes sense to put the framework inventory in a common location for each page to share.

CDN (Content Delivery Network) solves this problem. CDN is a network of servers that contains a shareable code base.

Google provides free CDN for a range of JavaScript libraries, including:

JQuery

Prototype

MooTools

Dojo

Yahoo! YUI

However, because Google is often blocked by GFW (Fire Great Wall, English name Great Firewall of China, abbreviated as Great Firewall, abbreviation GFW) in China, resulting in unstable access, Baidu static resource public library is recommended.

To use the JavaScript framework library in your web page, simply reference the library in the tag.

Use the frame:

Before you decide to use the JavaScript framework for your web pages, it is wise to test the framework first.

The JavaScript framework is easy to test. You don't need to install them on your computer, and you don't have an installer.

Usually you only need to reference a library file from a web page.

JavaScript-Test jQuery

Test JavaScript Framework Library-jQuery

Quote jQuery

To test the JavaScript library, you need to reference it in a web page. To reference a library, use a tag whose src attribute is set to the (address) URL of the library.

JQuery description:

The main jQuery function is the $() function (jQuery function). If you pass the DOM object to the function, it returns the jQuery object with the jQuery function added to it.

JQuery allows you to select elements through the CSS selector.

In JavaScript, you can assign a function to handle window loading events.

JQuery returns a jQuery object, which is different from the passed DOM object.

The properties and methods that jQuery objects have are different from those of DOM objects.

You cannot use the properties and methods of HTML DOM on jQuery objects.

JavaScript-Test Prototype

Test JavaScript Framework Library-Prototype

Quote Prototype

To test the JavaScript library, you need to reference it in a web page. To reference a library, use a tag whose src property is set to the library's URL.

Prototype description:

The functions provided by Prototype make HTML DOM programming easier.

Like jQuery, Prototype has its own $() function.

The $() function takes the id value (or DOM element) of the HTML DOM element and adds new functionality to the DOM object.

Unlike jQuery, Prototype does not have a ready () method to replace _ window.onload (). Instead, Prototype adds extensions to browsers and HTML DOM.

In JavaScript, you can assign a function to handle window loading events.

At this point, I believe you have a deeper understanding of "what are the libraries in javascript?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report