Document object model
If NN and IE are close in core JavaScript language compatibility, nothing could be further from the truth when it comes to the document objects. Internet Explorer 3 based its document object model (DOM) on that of Netscape Navigator 2, the same browser level it used as a model for the core language. When Netscape added a couple of new objects to the model in Navigator 3, the addition caused further headaches for neophyte scripters who expected those objects to appear in Internet Explorer 3. Probably the most commonly missed object in Internet Explorer 3 was the image object, which lets scripts swap the image when a user rolls the cursor atop a graphic—mouse rollovers, they’re commonly called.
In the Level 4 browsers, however, Internet Explorer’s document object model jumped way ahead of the object model Netscape implemented in Navigator 4. The two most revolutionary aspects of IE4 were the ability to script virtually every element in an HTML document and the instant reflow of a page when the content changed. This opened the way for HTML content to be genuinely dynamic without requiring the browser to fetch a rearranged page from the server. NN4 implemented only a small portion of this dynamism, without exposing all elements to scripts or reflowing the page. Inline content could not change as it could in IE4. Suffice it to say IE4 was an enviable implementation.
At the same time, a DOM standard was being negotiated under the auspices of the World Wide Web Consortium (W3C). The hope among scripters was that once a standard was in place, it would be easier to develop dynamic content for all browsers that supported the standard.
Netscape took this wish to heart and designed an almost entirely new browser: Navigator 6. It incorporates all of the W3C DOM Level 1 and a good chunk of Level 2. Even though Microsoft participated in the W3C DOM standards development, IE5 implements only some of the W3C DOM standard—in some cases, just enough to allow cross-browser scripting that adheres to the standard. Of course, the standard is not perfect either, and it brings to the DOM several brand-new concepts for scripters. When you take these issues into account, and add to the mix the number of older browsers still in use, scripting HTML objects is touchy business. It requires a good knowledge of compatibility, as described in the object discussions throughout this book.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home