When you load a page in Navigator, it creates a number of objects corresponding to the page, its contents, and other pertinent information.
Every page always has the following objects:
The properties of the document object are largely content-dependent. That is, they are created based on the content that you put in the document. For example, the document object has a property for each form and each anchor in the document.
For example, suppose you create a page named simple.html that contains the following HTML:
As always, there would be window, location, history, and document objects. These would have properties such as:
These are just some example values. In practice, these values would be based on the document's actual location, its title, foreground and background colors, and so on.
Navigator would also create the following objects based on the contents of the page:
These would have properties such as:
Notice that each of the property references above starts with "document," followed by the name of the form, "myform," and then the property name (for form properties) or the name of the form element. This sequence follows the Navigator's object hierarchy, discussed in the next section.
In this hierarchy, an object's "descendants" are properties of the object. For example, a form named "form1" is an object, but is also a property of document, and is referred to as "document.form1". The Navigator object hierarchy is illustrated below:
To refer to specific properties of these objects, you must specify the object name and all its ancestors. Exception: You are not required to include the window object.
The forms in a document are stored in an array called forms. The first (topmost in the page) form is forms, the second forms, and so on. So the above references could also be:
Likewise, the elements in a form, such as text fields, radio buttons, and so on, are stored in an elements array.
The window object is the "parent" object for all other objects in Navigator. You can always omit the object name in references to window properties and methods.
Window has several very useful methods that create new windows and pop-up dialog boxes:
The window object has properties for all the frames in a frameset. The frames are stored in the frames array. The frames array contains an entry for each child frame in a window. For example, if a window contains three child frames, these frames are reflected as window.frames, window.frames, and window.frames.
The status property enables you to set the message in the status bar at the bottom of the client window.