|[ LiB ]|
When an HTML page loads a browser such as Netscape Communicator or Internet Explorer, the browser defines a collection of objects based on the content it finds on the page. These objects are created in a top-down order as the page is loaded. As the browser builds the object references, it does so in a hierarchical fashion.
Because of the number of different versions of Internet Explorer and Netscape Communicator that have been developed over the years, there is no way that I can cover issues specific to each version of both browsers within the confines of this book. There are just too many different objects, and these objects have too many methods and properties to be covered in a single weekend . Therefore, I plan to cover the objects that you'll most likely need to work with. In addition, the scripts provided in this book will be written and tested using the latest versions of Internet Explorer and Netscape Communicator.
When a browser loads an HTML page, it simultaneously creates a logical view of all relevant objects into a tree-like structure. These objects are related to one another and have parent-child and sibling relationships. For example, consider the following HTML page:
<HTML> <HEAD> <TITLE>Script 3.1 - A Typical HTML page</TITLE> </HEAD> <BODY> <P>Hello.</P> <P>Welcome to my Web site.</P> </BODY> </HTML>
When loaded by a browser, you see the output shown in Figure 3.1.
The browser, on the other hand, sees the content of the HTML page a little differently, as depicted in Figure 3.2.
As you can see, the document object resides at the top of this tree. Underneath it are the various HTML tags that define its contents, and under these tasks is the content they contain.
|[ LiB ]|