400 Part III (Web hosting script) . Document Objects Reference About

January 24th, 2008

400 Part III . Document Objects Reference About this object In object models that reveal HTML element objects, the BODY element object is the primary container of the content that visitors see on the page. The BODY contains all rendered HTML. This special place in the node hierarchy gives the BODY object some special powers, especially in the IE object model. As if to signify the special relationship, both the IE and W3C object models provide the same shortcut reference to the BODY element: document.body. As a first- class HTML element object (as evidenced by the long lists of properties, methods, and event handlers covered in Chapter 15), you are also free to use other syntaxes to reach the BODY element. You are certainly familiar with several BODY element attributes that govern body-wide content appearance, such as link colors (in three states) and background (color or image). But IE and NN (and the W3C so far) have some very different ideas about the BODY element s role in scripting documents. Many methods and properties that NN considers to be the domain of the window (for example, scrolling, inside window dimensions, and so forth), IE puts into the hands of the BODY element object. Therefore, while NN scrolls the window (and whatever it may contain), IE scrolls the body (inside whatever window it lives). And because the BODY element fills the entire viewable area of a browser window or frame, that viewable rectangle is determined in IE by the body s scrollHeightand scrollWidth properties, whereas NN4+ features window.innerHeight and window.innerWidth properties. This distinction is important to point out because when you are scripting window- or document-wide appearance factors, you may have to look for properties and methods for the window or BODY element object, depending on your target browser(s). Note Use caution when referencing the document.body object while the page is loading. The object may not officially exist until the page has completely loaded. If you need to set some initial properties via scripting, do so in response to the onLoad event handler located in the tag. Attempts at setting BODY element object properties in immediate scripts inside the HEAD element may result in error messages about the object not being found. Properties aLink bgColor link text vLink Value: Hexadecimal triplet or color name string Read/Write document.body.aLink
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

399Chapter 18 .The Document and Body Objects On

January 23rd, 2008

398 Part III . Document (Web server certificate) Objects Reference The

January 23rd, 2008

397Chapter 18 .The Document and Body Objects document.write() (Free web space)

January 22nd, 2008

396 Part III . Document (Web site construction) Objects Reference A

January 22nd, 2008

395Chapter 18 .The Document and Body Objects routeEvent(event) (My web site)

January 21st, 2008

394 Part III (Web hosting comparison) . Document Objects Reference recalc([allFlag])

January 21st, 2008

Web design rates - 393Chapter 18 .The Document and Body Objects the

January 20th, 2008

392 Part (Web hosting e commerce) III . Document Objects Reference Another

January 20th, 2008

391Chapter 18 .The (Web hosting plans) Document and Body Objects open([ mimeType ]

January 20th, 2008