Properties of the DOCUMENT Object

This script displays nine document object properties. (There are more.) Pay close attention to the capitalization pattern of each property. Every time these properties are written, this pattern must be used. Why? Because JavaScript likes it that way! The properties used in this script are:

  1. bgColor returns background color in hexadecimal code
  2. fgColor returns foreground color in hexadecimal code
  3. linkColor returns link color in hexadecimal code
  4. alinkColor returns active link color in hexadecimal code
  5. vlinkColor returns visited link color in hexadecimal code
  6. location returns the URL, or location, of the page
  7. referrer returns the page the user came from before the current page. If no page is available, this property returns a blank space. For a page to be recognized as a referring page, a click must have been made to get to the page containing the document.referrer code. If the page containing this code was not arrived at by clicking, the property is returned as a blank space.
  8. title returns the text between the HTML document's TITLE commands
  9. lastModified returns the date the page was last modified (actually the date the page was uploaded or saved to the location)

These document properties are not in the script:

  1. cookie returns user's cookie text file
  2. anchors returns number of HREF anchors on the page
  3. forms returns an array (listing) of the form items on a page
  4. links returns a number for each individual link
Back Table of Contents Next