The first chapter

JavaScript was created in 1995 to do some basic validation tasks on the client side. Today, JavaScript has moved beyond simple data validation to the ability to interact with almost any aspect of the browser window and its content. JavaScript today is a full-featured programming language capable of handling complex computations and interactions, with features such as closures, anonymous (Lamda, Ramda) functions, and even metaprogramming.

In 1997, a proposal based on JavaScript 1.1 was submitted to the European Computer Manufacturers Association (ECMA). The association designated 39 Technical Committee (TC39, Technical Committee # 39) is responsible for the “standardized a universal, cross-platform, vendor neutral scripting language syntax and semantics” (www.ecmainternational.org/memento/TC3… TC39 is made up of programmers from Netscape, Sun, Microsoft, Borland, and other companies focused on scripting languages, They worked for months to complete ECMA-262, a standard for defining a new scripting language called ECMAScript (pronounced “Ek-MA-script”).

The second year, ISO/IEC (International Organization for Standardization and International Electrotechnical Commission), The ISO and the International Electrotechnical Commission have also adopted ECMAScript as a standard (ISO/IEC-16262). Since then, browser developers have been working on using ECMAScript as the basis for their JavaScript implementations, with varying degrees of success.

1.1 JavaScript implementation

Although JavaScript and ECMAScript are often used to express the same meaning, JavaScript has much more meaning than ecMA-262 dictates. A complete JavaScript implementation should consist of three distinct parts: the core (ECMAScript), the Document Object Model (DOM), and the Browser Object Model (BOM).

1.1.1 ECMAScript

Our common Web browser is just one possible hosting environment for an ECMAScript implementation. The host environment not only provides the basic ECMAScript implementation, but also provides extensions to the language for interfacing between the language and the environment. These extensions, such as DOM, leverage ECMAScript’s core types and syntax to provide more specific functionality for context-specific operations. Other hosting environments include Node (a server-side JavaScript platform) and Adobe Flash.

The ECMA-262 standard specifies the following components of the language: syntax, types, statements, keywords, reserved words, operators, and objects

ECMAScript is a description of the language that implements the various aspects of the standard. JavaScript implements ECMAScript, as does Adobe ActionScript.

ECMAScript compatibility: Support for all “types, values, objects, properties, functions, and program syntax and semantics” described by ECMA-262; Supports Unicode character standards.

Compatible implementations can also make the following extensions: add “more types, values, objects, properties, and functions” that are not described by ECMA-262. These new features mentioned in ECMA-262 mainly refer to new objects and new properties of objects not specified in this standard; Support for “program and regular expression syntax” not defined by ECMA-262.

The following table lists how ECMAScript is supported by major Web browsers

1.1.2 Document Object Model (DOM)

The Document Object Model (DOM) is an Application Programming Interface (API) for XML but extended for HTML. DOM maps the entire page to a multi-level node structure. Each component of an HTML or XML page is a node of some type, which in turn contains a different type of data.

1.1.3 Browser Object Model (BOM)

Basically, the BOM only deals with browser Windows and frames; But it is also customary to count all JavaScript extensions for browsers as part of the BOM. Since there is no BOM standard to follow, each browser has its own implementation. While there are de facto standards, such as window objects and Navigator objects, each browser defines its own ownership and methods for these and other objects. Now with HTML5, the details of BOM implementation are expected to evolve in the direction of increasing compatibility.

The JavaScript version 1.2

Mozilla, the successor to Netscape, is the only browser developer that still uses the original JavaScript version number sequence. At the time Netscape submitted the source code to the open source Mozilla project, the last version number of JavaScript in the browser was 1.3. (As mentioned earlier, version 1.4 is a server-only implementation.) Later, as the Mozilla Foundation continued to develop JavaScript, adding new features, keywords, and syntax, the version numbers continued to increase.

1.3 summary

JavaScript is a scripting language designed specifically for interacting with web pages. It consists of three distinct parts: ECMAScript, defined by ECMA-262, which provides core language functionality; Document Object Model (DOM), which provides methods and interfaces for accessing and manipulating web content; The Browser Object Model (BOM) provides methods and interfaces for interacting with the browser.

All three components of JavaScript are supported to varying degrees in the current five major browsers (IE, Firefox, Chrome, Safari, and Opera). Support for ECMAScript version 3 is generally good across all browsers, and support for ECMAScript 5 is growing, but DOM support varies considerably. While certain well-known common features are implemented across browsers in the BOM, which has been formally incorporated into the HTML5 standard, others vary from browser to browser.

Chapter two summary

JavaScript is inserted into an HTML page through a

(1) To include external JavaScript files, you must set the SRC property to the URL of the file to include. Files can be on the same server as web pages, or they can be in completely different domains.

(2) All

(3) For scripts that do not delay execution, the browser must finish interpreting the code in the