“JavaScript Advanced Programming (3rd edition)” study notes


Keywords: a brief history of JavaScript, related standards, DOM and BOM

1. JavaScript’s past and present

1.1 JavaScript a brief history of

  1. Initially: Handles some of the input validation that the server-side language does, validating forms

  2. The Netscape Navigator 2 scripting language LiveScript was changed to JavaScript

  3. Microsoft added JScript to IE 3

  4. In 1997, ECMA adopted the standard ECMAScript, which browser developers have since used as the basis for their JavaScript implementations

2. JavaScript related standards and implementation

Three parts: ECMAScript, DOM, BOM (Note: BOM is the browser object model)

ECMAScript 2.1:

Defined by ECMA-262, it provides core language functionality

  1. Defines: syntax, type, statement, keyword, reserved word, operator, object
  2. Version evolution:
  • First edition: essentially the same as JavaScript1.1 in Netscape, with support for the Unicode standard and multilingual development
  • Second edition: the result of editing and processing in order to be consistent with ISO/IEC-16262, but no updates
  • Third edition: the first formal modification of the standard, modified string handling, error definition, numerical output; New re, new control statement, and try-catch exception control
  • Fourth edition: A comprehensive review of language revision. Include strongly typed variables, new statements, new data structures, classes, integrations, and define new ways to interact with data
  • Fifth edition: contains native JSON, inheritance methods, advanced property definitions, strict schemas, and more

2.2 Document Object Model DOM:

Provides methods and interfaces for accessing and manipulating web content

An application programming interface (API) for XML but extended for HTML.

Map the entire page to a multi-level node structure

  1. The DOM level:
  • DOM1: Map document structure

  • DOM2: extended mouse and user interface events, scope, traversal, CSS support

  • DOM3: DOM loading and saving module: a unified way to load and save documents;

  1. DOM validation module: Added document methods

  2. Other DOM standards: SVG, MathML, DMIL

2.3 BOM of browser Objects

Provides methods and interfaces for interacting with the browser

Control over parts of the browser that are not displayed, but lack standards; (Solve this problem in H5)

Note: this will be explained in more detail in subsequent chapters

  1. BOM extension:
  • Pop-up Browser window
  • Move, zoom, and close the browser window
  • A Navigator object that provides details about the browser
  • A Location object that provides details about the page loaded by the browser
  • Screen object that provides details about the resolution of the user’s display
  • Support cookies
  • Custom objects like XMLHttpRequest and IE’s ActiveXObject

Table of Notes:

JavaScript Learning (1) – A history of JavaScript

JavaScript Learning (2) – Basic syntax

Learning JavaScript (3)- Talk about prototype chains – 1. Variables

Learning JavaScript (3)- Talk about prototype chains – 2. Objects and prototypes

Learning JavaScript (3)- Talk about prototype chains – 3. Prototype chains and inheritance

JavaScript Learning (4)- Talk about closures

Github:

Github Notes link (continue to update, welcome star, please mark source for reprint)