78 Part III . (Make my own web site) Document Objects Reference The

78 Part III . Document Objects Reference The only potential problems you could encounter with your existing code have to do with a handful of properties that used to belong to the documentobject. In the new DOM, four style-related properties of the document object (alinkColor, bgColor, linkColor, and vlinkColor) become properties of the body object (ref erenced as document.body). In addition, the three link color properties pick up new names in the process (aLink, link, vLink). It appears, however, that for now, IE5.x and NN6 maintain backward compatibility with the older 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 screen are not part of the DOM specification through Level 2. Scripters are still at the mercy of browser makers for compatibility in these areas, but the windowobject likely will be added to the W3C DOM in the future. What isn t available As mentioned earlier, the W3C DOM is not simply a restatement of existing browser specifications. Many convenience features of the IE and NN object models do not appear in the W3C DOM. If you develop Dynamic HTML content in IE4+ or NN4, you have to learn how to get along without some of these conveniences. Navigator 4 s experiment with the tag was not successful in the W3C process. As a result, both the tag and the scripting conventions surrounding it do not exist in the W3C DOM. To some scripters relief, the document.layerName ref erencing scenario (even more complex with nested layers) disappears from the object model entirely. A positioned element is treated as just another element that has some special style sheet attributes that enable you to move it anywhere on the page, stack it amid other positioned elements, and hide it from view. Among popular IE4+ features missing from the W3C DOM are the document.all collection of HTML elements and four element properties that facilitate dynamic content: innerHTML, innerText, outerHTML, and outerText. A new W3C way pro vides for acquiring an array of all elements in a document, but generating HTML content to replace existing content or be inserted in a document requires a tedious sequence of statements (see the section New DOM concepts later in this chapter). Netscape, however, has implemented the innerHTMLproperty for HTML element objects in NN6. If you have a lot of legacy IE4 code that uses the other missing prop erties that you want to use for NN6, see the section Simulating IE4 Syntax in NN6 later in this chapter. New HTML practices Exploitation of Dynamic HTML possibilities in both IE4+ and the W3C DOM relies on some HTML practices that may be new to long-time HTML authors. At the core of these practices (espoused by the HTML 4.0 specification) is making sure that all content is within an HTML container of some kind. Therefore, instead of using the

tag as a separator between blocks of running text, surround each paragraph of the running text with a

tag set. If you don t do it, the browser treats each

tag as the beginning of a paragraph and ends the paragraph element just before the next

tag or other block-level element.
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

Leave a Reply