In this section, we give a very brief introduction to JavaScript; for more details see [F97,KK97]). JavaScript is a simple procedural language that is interpreted by Web browsers from Netscape. (JScript, Microsoft's implementation, is a clone that is interpreted in Microsoft's Web browsers.) JavaScript is object-based in the sense that it uses built-in and user-defined extensible objects, but there are no classes or inheritance. The code is integrated with, and embedded in, HTML. By default, JavaScript provides an object-instance hierarchy that models the browser window and some browser state information. For example, the navigator object provides information about the browser to a script, and the history object represents the browsing history in the browser window.
Also, through a process called reflection, JavaScript automatically creates an object-instance hierarchy of elements of the script's HTML document when it is loaded by the browser. The location object represents the URL of the current document, while the document object encapsulates HTML elements (forms, links, anchors, images, etc.) of the current document. The reflection process defines a unique name space for each HTML page and thus for each collection of scripts embedded in that page. JavaScript is loosely typed: variables' data types are not declared. JavaScript uses dynamic binding: object references are resolved at runtime.