One of the most powerful aspects of scripting languages is there ability to interact with the web browsers. Scripts have access to each element within the page by using the document object model, or DOM. Essentially, this is a hierarchy that begins with the document as a whole, and then allows the programmer to reference parts of the page to whatever detail necessary. The Document Object Models for Microsoft Internet Explorer, Netscape, and Mozilla Firefox are very similar (see Image 1).
Image 1: DOM for Microsoft Internet Explorer
Knowledge of the DOM is important, but modern coding standards correctly suggest that you should avoid browser detection altogether, and in its place use object detection. A useful tutorial about the javascript standards of object detection can be found at bytes.com: A Guide to Coding Cross-Browser Scripts
.
The DOM also gives the developer the ability to rewrite a page using the document's write method. Writing in a new window can create potential accessibility issues and therefore should be avoided. The problem is that the assistive technologies may not be notified that new information was generated, usually because the secondary window does not have focus.
The next page will discuss pop-up windows.