Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

JavaScript library


May 06, 2021 JavaScript


Table of contents


JavaScript Library


JavaScript Library - jQuery, Prototype, MooTools.


JavaScript Framework (Library)

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

To cope with these adjustments, many JavaScript libraries have come into being.

These JavaScript libraries are often referred to as javaScript frameworks.

In this tutorial, we'll learn about some of the most popular JavaScript frameworks:

  • Jquery
  • Prototype
  • MooTools

All of these frameworks provide functions for common JavaScript tasks, including animation, DOM operations, and Ajax processing.

In this tutorial, you'll learn how to get started with 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 manipulate HTML elements (DOM objects) on web pages.

jQuery provides both the companion UI (user interface) and the plug-in.

Many large companies use jQuery on their websites:

  • Google
  • Microsoft
  • Ibm
  • Netflix

To learn more about jQuery, visit our jQuery tutorial.


Prototype

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

The API is an abbreviation for the Application Programming Interface. It is a library of properties and methods for working with HTML DOMs.

Prototype enables javaScript enhancements by providing classes and inheritance.

Tip: T he biggest part of the Prototype framework is the extension of the DOM. The $() function in the Prototype framework is able to return a web DOM element, which the framework adds a lot of convenient methods to.


MooTools

MooTools is also a framework that provides APIs that make common JavaScript programming easier.

MooTools also contains some lightweight effects and animation functions.

Tip: Although Mootools has almost the same syntax as Prototype, it provides more functionality than Prototype and is more powerful, with useful and clear documentation and examples to help you get started.


Other frameworks

Here are some other frameworks that are not covered above:

YUI - Yahoo! User Interface Framework, a large library of functions, from simple JavaScript functionality to complete Internet widgets.

Ext JS - Customizable widget for building rich Internet applications.

Dojo - a toolkit for DOM operations, events, widgets, and more.

script.aculo.us - An open source JavaScript framework for visual effects and interface behavior.

UIZE - Widget, AJAX, DOM, templates, and more.


CDN - Content distribution network

You always want the page to be as fast as possible. You want the page to have as little capacity as possible, and you want your 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.

The CDN (Content Delivery Network) addresses this issue. A CDN is a network of servers that contain a code base that can be shared.

Google offers free CDNs for a range of JavaScript libraries, including:

  • Jquery
  • Prototype
  • MooTools
  • Dojo
  • Yahoo! YUI

However, since Google is often blocked in China by GFW (Fire Great Wall, English name Great Firewall of China, short for Great Firewall, abbreviated GFW) resulting in unstable access, it is recommended to use Baidu's static resource public library: http://cdn.code.baidu.com/.

To use the JavaScript framework library in your Web pages, simply refer to it in the hashtag:

Refer to jQuery

<script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js" rel="external nofollow" >
</script>


Use the framework

Before you decide to use the JavaScript framework for your Web pages, it's 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.

Typically, you only need to reference a library file from a Web page.

In the next chapter of this tutorial, we'll give you a complete look at jQuery's testing process.


Related tutorials

HTML DOM tutorial