179Chapter 14Document Object Model EssentialsMore importantly, when you (Web file server)
Monday, September 17th, 2007179Chapter 14Document Object Model EssentialsMore importantly, when you consider the changes to referencing other elements in the W3CDOM (discussed in the next section), we re lucky that the old ways of referencing objectssuch as forms, form control elements, and images still work. Had the working group beenplanning from a clean slate, it is unlikely that the documentobject would have been givenproperties consisting of arrays of forms, links, and images. The only potential problems you could encounter with your existing code have to do with ahandful of properties that used to belong to the documentobject. In the new DOM, fourstyle-related properties of the documentobject (alinkColor, bgColor, linkColor, andvlinkColor) become properties of the bodyobject (referenced as document.body). In addi- tion, the three link color properties pick up new names in the process (aLink, link, vLink). It appears, however, that for now, IE6 and Moz1 maintain backward compatibility with theolder document object color properties. Also, note that the DOM specification concerns itself only with the document and its content. Objects such as window, navigator, and screenare not part of the DOM specification throughLevel 2. Scripters are still at the mercy of browser makers for compatibility in these areas, butthe windowobject (or its equivalent) likely will be added to the W3C DOM Level 3. What isn t availableAs mentioned earlier, the W3C DOM is not simply a restatement of existing browser specifica- tions. Many convenience features of the IE and NN object models do not appear in the W3CDOM. If you develop Dynamic HTML content in IE4+ or NN4, you have to learn how to getalong without some of these conveniences. Navigator 4 s experiment with the tag as a separator between blocksof running text, surround each paragraph of the running text with a
… tag set. Ifyou don t do it, the browser treats each
tag as the beginning of a paragraph and ends theparagraph element just before the next
tag or other block-level element. While recent browsers continue to accept the omission of certain end tags (for td, tr, and lielements, for instance), it is best to get in the habit of supplying these end tags. If for no otherreason, they help you visualize where an element s sphere of influence truly begins and ends.