What is JavaScript

1.1 Historical Review:

1.2 JavaScript implementation:

JavaScript is a scripting language used to interact with web pages. A complete JavaScript implementation consists of the following parts:

  • Core (ECMAScript) : Defines and provides core functionality by ECMAScript
  • Document Object Model (DOM) : Provides methods and interfaces for interacting with web content
  • Browser Object Model (BOM) : Provides methods and interfaces for interacting with the browser

1.2.1 Core ECMAScript:

ECMAScript, the language defined by ECMA-262, has no input/output methods.

A Web browser is a host environment for ECMAScript implementations. The host environment provides the baseline implementation of ECMAScript and the extensions necessary for the environment’s own interactions. DOM is an extension that uses ECMAScript core types and syntax to provide additional functionality specific to the environment.

Without involving browsers, ECMA-262 defines syntax, types, statements, keywords, reserved words, operators, and global objects.

ECMAScript is simply the name given to a language that implements all aspects of the specification. JavaScript implements ECMAScript, as does Adobe ActionScript.

To be an ECMAScript implementation you must: support all the “types, values, objects, properties, functions, and program syntax and semantics” described in ECMA-262; Supports Unicode character standards.

1.2.2 DOM

The Document Object Model is an application programming interface for using extended XML in HTML.

The W3C (World Wide Web Consortium) has developed DOM Level 1, a DOM recommendation standard, which consists of the following two modules:

  • DOM Core: Provides a way to map XML documents, making it easy to access and manipulate any part of the document;
  • DOM HTML: Extends DOM Core with htML-specific objects and methods.

1.2.3 BOM

IE3 and Netscape Navigator 3 provide the Browser object model API to support accessing and manipulating the browser’s Windows. Using the BOM, developers can manipulate the parts of the browser that are not displayed on the page.

BOM is the only JavaScript implementation that doesn’t have a standard (HTML5 covers as many BOM features as possible in a formal specification).

The BOM is primarily for browser Windows and child Windows, but usually browser-specific extensions are also included in the BOM, such as:

  • The ability to pop up a new browser window;
  • The ability to move, zoom, and close browser Windows;
  • The Navigator object, which provides detailed information about the browser;
  • Location object, provided; Detailed information about the browser loading page;
  • Screen object, which provides detailed information about the user’s screen resolution;
  • Performance object that provides detailed information about browser memory usage, navigation behavior, and time statistics;
  • Cookie support;
  • Other custom objects, such as XMLHttpRequest and IE’s ActiveXObject.

1.3 JavaScript Version:

1.4 summary:

The three parts of JavaScript are supported to varying degrees by all five major browsers (IE, Firefox, Chrome, Safari, Opera).

ES5 is basically fully supported by all browsers; DOM support varies among these browsers.

The BOM included in HTML5 will vary from browser to browser, but developers can still assume that there are a large number of common features.