Previous Example-|-Next Chapter's Examples-|-Return to Chapter Listing
Example 10.9:
The Object Hierarchy
Okay, so this isn't a real example. Rather, it's an interactive table showing the Object Hierarchy. Click on links to "drill down" the hiearchy and see what's a property of what. Remember, if a property has its own properties, then it is an object in its own right, as well as being a property of the object one level up the hierarchy.
How to Use This Table
Each document in this table lists an object's properties. The properties that are links are also objects in their own right...click on the link to see their properties.
This document contains information about the top-level and built-in objects, navigator, window, Array, Math, Date, and string.
The navigator Object
This is a top-level object. It's not really part of a hierarchy, as it is descended from no other object, and is the parent of no other object:
- appCodeName: the browser code name.
- appName: the browser name.
- appVersion: the browser version information.
- userAgent: the information from the HTTP user-agent header
The window Object
The top-level object in the hierarchy is the window. The window has these properties:
- defaultStatus: the default status-bar message.
- document: information about the current document.
- frame: information about a frame held by the window.
- frames: an array listing all the frames in a window.
- history: the history list.
- length: the number of frames in the window.
- location: information about the URL of the current document (note that there's a property of the document object also called location...this is a different thing!).
- name: the windowName
- opener: refers to the window in which a script used window.open to open the current window. This is a new property, introduced with Netscape Navigator 3.0, beta 3.
- parent: refers to the parent window when working in a frame.
- self: refers to the current window (the same as the window property).
- status: a temporary status-bar message.
- top: the top browser window.
- window: refers to the current window (the same as self).
The Array Object
The array object is a new one, introduced with Netscape Navigator 3.0, beta 3, so it wonít work with Netscape 2.0. Itís a built-in object, so itís not a property of another object. It has a single property:
- length: The number of values held in the array.
The Date Object
The Date object is not descended from another object, and has no properties.
The Math Object
The Math object is not descended from another object. It has these properties:
- E: Euler's constant and the base of natural logarithms (approximately 2.718).
- LN2: The natural logarithm of two (approximately 0.693).
- LN10: The natural logarithm of ten (approximately 2.302).
- LOG2E: The base 2 logarithm of e (approximately 1.442).
- LOG10E: The base 10 logarithm of e (approximately 0.434).
- PI: The value of pi, (approximately 3.14159).
- SQRT1_2: The square root of one-half (one over the square root of two approximately 0.707).
- SQRT2: The square root of two (approximately 1.414).
The string Object
The string objects are created when you create a string; they are not descended from other objects. They have this property:
- length: The number of characters in the string.
Previous Example-|-Next Chapter's Examples-|-Return to Chapter Listing