- Every Javascript program runs in a context. In the browser, each window has
a context.
- The context is represented by an implicit object, which you can refer
to as this when not obviously running in some other object.
- Contents can be referred to as this.name or just name.
- Contents
- Self-references, alias for root, such as window.
- References to roots of related windows, such a parent or child frames.
- Built-in functions, including for controlling the window.
- Built-in basic classes, such as String and Math.
- location object. Current URL and some other things.
- history object. Limited use in current JS for security reasons.
- screen object. Display parameters.
- document object. The document tree, or DOM tree. Where
the action is.
- document.head
- document.body
- .children[i]
- Some browsers add all elements having a name or id attribute, so
you can refer to DOM objects directly by their id.