First, JavaScript introduction

Source: Internet
Author: User
Tags hosting

JavaScript was born in 1995, when its main purpose was to handle input validation operations (the frequent exchange of data with a server without completing simple forms validation would only add to the burden on the user). Before the advent of JavaScript, the form data must be sent to the server to determine whether the user filled out a required field and entered an invalid value. Today's JavaScript is no longer limited to simple data validation, but has the ability to interact with almost all aspects of the browser window and its content, which is now a fully functional programming language capable of handling complex computations and interactions, with closures, anonymous functions , and even meta-programming features.

JavaScript implementation

While JavaScript and ecnmascript are often used to express the same meaning, JavaScript has more to say than ECMA-262, which defines a standard called ecmasctipt new scripting language. A complete JavaScript implementation should consist of the following three different parts.

1. Core ECMAscript

The ECMAScript defined by ECMA-262 does not have a dependency on the Web browser, in fact the language itself does not contain input and output definitions, and ECMA-262 defines only the basis of the language, on which a more complete scripting language can be built. Our common web browser is just one of the possible hosting environments for ECMAScript implementations. The hosting environment not only provides a basic ECMAScript implementation, but also provides an extension of the language for the interface between the language and the environment. These extensions, such as the DOM, use the core types and syntax of ECMAScript to provide more specific functionality to enable operations against the environment.

The ECMA-262 standard does not refer to a Web browser, what does it stipulate? Broadly speaking, it prescribes the following components of the language:

* Grammar

* Type

* Statement

* Key Words

* Reserved words

* operator

* Object

2. Document Object Model DOM

The DOM (documnet Object Model) is an application programming interface for XML that has been extended for HTML, and the DOM maps the entire page into a multi-tiered node structure. Each component of an HTML or XML page is a node of a certain type, and these nodes contain different types of data. By creating a tree representation of the document in the DOM, the developer has the initiative to control the content and structure of the page. With the API provided by DOM, you can delete, add, replace, and modify any node with ease.

DOM level: The DOM1 level became the standard recommendation in October 1998. The DOM1 level consists of two modules, the DOM core and the Dom HTML. The DOM core specifies how to map an XML-based document structure to simplify access and manipulation of any part of the document. Dom HTML modules are expanded on the basis of the DOM core, adding objects and methods for HTML. (Note: Dom is not for JavaScript only, and many other languages implement DOM as well.) )

The DOM2 level is based on the original DOM by expanding the mouse and user interface events, scopes, traversal (methods of iterating DOM documents) and other subdivision modules, and through the object interface to add support for CSS.

The DOM3 scale further expands the DOM, introducing a way to load and save documents in a uniform manner-defined in DOM loading and saving modules, and new methods for validating documents-defined in the DOM validation module.

Other DOM standards are: SVG (Scalable vector graph), MathML (mathematical Markup Language), SMIL (Synchronous Multimedia Integration language).

3. Browser Object Model BOM

The BOM (Browser object model) is a browser-based, user-modeled system that accesses and operates the browser window, and uses a BOM to control parts of the page that the browser displays. But the BOM does not have a standard, the problem is solved in HTML5, HTML5 is committed to the many BOM functions written to the formal specifications.

First, JavaScript introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.