Chapter Content: JavaScript History Review, what JavaScript is, JavaScript vs. ECMAScript, different versions of JavaScript
A complete JavaScript implementation should consist of the following three different parts.
- Core (Ecmascipt)
- Document Object Model (DOM)
- Browser object Model (BOM)
- ECMAScript
The ECMAScript defined by ECMA-262 has no dependencies on the Web browser. In fact, the language itself does not contain input and output definitions. It defines only the basis of this language, and on top of that it builds a more complete scripting language. Web browser Knowledge ECMAScript implements one of the possible hosting environments. The hosting environment not only provides a basic ecmascipt implementation, but also provides an extension of the language for the interface between the language and the environment. Other hosting environments include node (a server-side JavaScript platform) and Adobo Flash.
Ecmascipt is made up of syntax, type, statement, keyword, reserved word, operator, object . Is the description of the language that implements the various aspects of the standard provision.
2. Document Object Model (DOM)
The Document Object model (Dom,document object models) is an application programming interface (Api,application programming Interface) for XML but extended for HTML. 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. look at the following example:,
The Development clerk has the initiative to control the content and structure of the page, created by the DOM, which represents the document's tree shape. With the API provided by the DOM, developers can easily delete, add, replace, or modify any node.
1: Why use the DOM
Keeping the Web cross-platform nature in control of Netscape and Microsoft prevents the Web development domain from being technically two-strong and browser incompatible.
2:dom level
Dom is not just for JavaScript, but also for many other languages. In the Web browser. Dom implemented based on ECMAScript has become an important part of JavaScript language
DOM0 (DOM level 0)
In fact, the DOM0 level does not exist, just a parameter point in the DOM's historical coordinates.
Refers to the DHTML originally supported by the Internet Explorer4.0 and Netscape Navigator4.0.
DOM1 (DOM Level 1)
Two modules consisting of the DOM core (DOM cores) and Dom HTML.
Dom Core: The primary mapping is based on the structure of the XML document to simplify access and manipulation of any part of the document.
DOM HTML: Expands on the do core, adding objects and methods for HTML.
DOM2 (DOM Level 2)
The introduction of new modules also gives the definition of many new types and new interfaces.
Dom View: Defines an interface for tracking different document views;
DOM Event: Defines the interface for event and event handling;
Dom Style: Defines the interface for applying styles to elements based on CSS;
DOM Traversal and scoping: Defines the interfaces that traverse and manipulate the document tree.
DOM3 (DOM level 3)
The method of loading and saving documents in a uniform manner-defined in the DOM loading and saving module;
New ways to validate documents-defined in the DOM validation module.
Other DOM standards
The following languages are XML-based, and each language's DOM standard adds new methods and interfaces that are relevant to a particular language:
SVG (Scalable vector graph) 1.0; MathML (mathematical Markup Language) 1.0;smil (Synchronous Multimedia Integration language).
Although Mozilla's XUL (user interface language) also has its own DOM implementation, only the above languages are the recommended standard.
Web browser support for DOM
3. Browser object Model (DOM)
Browser object models (DOM Browser object model): supports the ability to access and manipulate browser windows, and developers use BOMs to control parts of the page that the browser displays.
Fundamentally, the BOM only handles browser windows and frames, and it is customary to count all browser-specific JavaScript extensions as part of the BOM. Here are some of these extensions
- Popup new browser window function;
- The ability to move, zoom, and close the browser window;
- A Navigator object that provides detailed information about the browser;
- A Location object that provides detailed information about the page loaded by the browser;
- A screen object that provides detailed information about the user's display resolution;
- (a) Support for cookies;
- Want to XMLHttpRequest and IE ActiveXObject such a custom object.
Version 4.JavaScript
Summary:
JavaScript is a scripting language designed to interact with Web pages. Consists of the following three different parts:
ECMAScript, defined by ECMA-262, provides core language functions;
Document Object Model (DOM), which provides methods and interfaces for accessing and manipulating Web page content;
A Browser object model (BOM) that provides methods and interfaces for interacting with the browser;
These three components are supported by varying degrees in the current five main browsers (IE, Firefox, Chrome, Safari, Opera). can achieve some well-known common features, but other features may vary by browser.
JavaScript Advanced Programming (1) Introduction