Web scripting (Definition)

Web browsers provide a host environment for client-side computation.

Availability:

ECMAScript edition - 2

Web browsers provide a host environment in which to view a web page downloaded from a remote server or from a local file system. Scripts running in that browser use an object model representation of the browser and the presently viewed document. These are called the Browser Object Model and the Document Object Model respectively. There are objects to represent windows, dialog boxes, alerts, text areas, anchors, frames and all the functionality that the browser provides through its graphical user interface.

The host environment provides a means of connecting events to scripts and those scripts are then triggered when the user interacts with the document or browser. Because the entire complex provides a framework for execution and that execution is event driven, there is no main() function as you would have with the C language for example.

JavaScript that executes in the browser is called client-side script code. Similar script code can be executed in the web server as part of the web page request-response loop. That code would generally be executed in a more serial fashion in response to a single event (generate a page). This sort of activity is called server-side scripting.

A complete web-based application can be built with code distributed between the server and client environments.

Cross-references:

ECMA 262 edition 2 - section - 4.1

ECMA 262 edition 3 - section - 4.1