The generation and development of JavaScript and DOM

Source: Internet
Author: User

First, this article is excerpted from: http://itbilu.com/javascript/js/Vyxodm_1g.html

Thanks to the author of this article, he has cleared the clutter of DOM level in my image. Let me know that the DOM0 level does not exist, and we are now commonly used coredom, html-dom are DOM1 level, and the interface of the event is introduced from the DOM2 level.

====================== Specific Content =====================

JavaScript has undergone a dramatic shift from being misunderstood to the present. With the introduction of some JavaScript programming specifications (e.g. AMD, CMD), the scope of application extends from some small functions in the front to the backend and some large projects. So what's the process of JavaScript going from chaos to rigor, and what features does JavaScript add to these processes?

1. The origins and development of JavaScript 1.1 JavaScript

JavaScriptThe original Netscape Brendan Eich design, which was Netscape initially named after its scripting language LiveScript , was later Netscape Sun renamed after cooperating with it JavaScript . From this point of view, JavaScript just for marketing reasons, it looks like Java Java there is no relationship.

Before the advent of the JavaScript Web browser is only a kind of software that can display hypertext documents, after the advent of the JavaScript Web page interactivity has been significantly improved, its content is no longer limited to simple text. The JavaScript first version, namely: JavaScript 1.0 , was launched in the 1995 Netscape Navigator 2 browser.

The JavaScript 1.0 browser also dominates when it is released Netscape Navigator . Microsoftthe IE 3.0 name is published at the time VBScript of the JScript . In the face of Microsoft's competition, the Netscape Sun language has been standardized in conjunction with the Consortium ECMA (the European Computer Manufacturing Association), JavaScript namely: ECMA-262 (ECMAScript), the language standard we use today JavaScript , The latest standard is ECMAScript 6.

1.2 JavaScript design features

JavaScriptOriginally designed as a scripting language for non-program personnel, as JavaScript an interpreted scripting language, it is often possible to rely on a Web browser to perform some operations rather than running independently as a dynamic language. It is also because JavaScript of the simplicity that makes it easier to learn and use.

JavaScriptProvides users with some APIs to manipulate Web browsers and Web documents, namely, the BOM (browser object model) and the DOM (Document Object model). You can JavaScript adjust the width, height, and location of your browsing, and you can also JavaScript adjust the display, hide, form submission, etc. of Web page content.

2. The advent and development of the DOM 2.1 DOMWhat is it

DOM, Document Object model. DOMis W3C the standard for (World Wide Web Consortium), which DOM defines the criteria for access HTML and XML documentation. In W3C the standard, DOM it is a platform-and language-independent interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document.

W3C DOMConsists of the following three parts:

    • 核心DOM-Standard Model for any structured document
    • XML DOM-Standard Model for XML documents
    • HTML DOM-Standard Model for HTML documents

2.2 DOMThe difference between the development of-DOM0, DOM1, DOM2 and DOM3

DOM0

JavaScriptIn earlier versions, the content APIs for querying and manipulating Web documents (such as images and forms) were defined, defined, and so on, JavaScript ‘images‘ ‘forms‘ so that we could access the first image or a form named "User" as follows:

document.images[0]document.forms[' user ']

This is actually not the standard experimental nature of the primary stage of the DOM, which is now customary DOM0 to be called, namely: 第0级DOM . Due to the DOM0 W3C appearance before the preparation of the label, but also in the initial stage of non-formed standards, Netscape and Microsoft their respective launch of their own fourth-generation browser, since the DOM all over the beginning of a variety of problems.

DOM0 and DHTML

Netscape Navigator 4And IE4 released in 1997 in June and October, both browsers have been massively expanded DOM to make JavaScript the function greatly increased, and at this time also began to appear a term: DHTML .

DHTMLis Dynamic HTML the abbreviation for (Dynamic HTML). DHTMLis not a new technology, but a description of the combination of HTML, CSS, and JavaScript technology. That

    • Use HTML to mark Web pages as various elements
    • Using CSS to set element styles and their display locations
    • Manipulate page elements and styles with JavaScript

With DHTML, it seems easy to control page elements and implement a very complex effect (e.g., animating by changing the position of an element). This is not the case, because there is no specification or standard, and the two browsers implement the same functionality completely differently. To maintain the compatibility of the program, the programmer must write some probing code to detect which browser the JavaScript is running under and provide the corresponding script. JavaScriptinto the unprecedented chaos, and DHTML therefore in people's minds left a very bad impression.

The advent of DOM1

Browser Manufacturers in the browser at the same time, W3C combined with the advantages of the introduction of a standardized DOM , and completed in October 1998 第一级 DOM , namely: DOM1 . W3Cwill be DOM defined as a platform-and programming-language-independent interface through which the content, structure, and style of the document can be accessed and modified dynamically by this interface program and script.

DOM1Level primarily defines the underlying structure of HTML and XML documents. In DOM1 , the DOM consists of two modules: DOM Core (DOM core) and DOM HTML . It DOM Core provides an XML-based document structure standard that simplifies access and manipulation of any part of the document. DOM HTMLis expanded on the basis of the DOM core, adding objects and methods for HTML, such as: objects in JavaScript Document

DOM2 and DOM3

On DOM1 the basis of DOM2 and DOM3 introduced more interactive capabilities, but also support the more advanced XML features. DOM2and DOM3 divide the DOM into more connected modules. DOM2 level in the original DOM based on the expansion of the mouse, user interface events, scopes, traversal and other subdivision modules, and through the object interface to increase the support for CSS. DOM1the DOM core modules in the class are also extended to support XML namespaces. The DOM2 following modules are introduced in, and the modules contain many new types and new interfaces:

    • DOM视图(DOM views): Defines an interface that tracks different view of a document
    • DOM事件(DOM events): An interface that defines event and event handling
    • DOM样式(DOM Style): Defines an interface that applies styles to elements based on CSS
    • DOM遍历和范围(DOM Traversal and Range): Defines an interface for traversing and manipulating the document tree

DOM3Further expanded the DOM by DOM3 introducing the following modules in:

    • DOM加载和保存模块(DOM load and Save): introduces methods for loading and saving documents in a uniform manner
    • DOM验证模块(DOM Validation): Defines a method for validating a document
    • DOM核心的扩展(DOM Style): Supports XML 1.0 specification, involving XML Infoset, XPath, and XML Base

The generation and development of JavaScript and DOM

Related Article

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.