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