345Chapter 18 .The Document and Body Objects (X web hosting) Table
345Chapter 18 .The Document and Body Objects Table 18-1 Setting Document Colors on the Fly (Browser Versions) Navigator Internet Explorer Color Property bgColor All others Windows Mac All 4+ 6 6 UNIX Windows Mac UNIX 4+ All All 4+ 6 All All 4+ If you experiment with setting document.bgColor on Mac or UNIX versions of Navigator 2 and 3, you may be fooled into thinking that the property is being set correctly. While the property value may stick, these platforms do not refresh their windows properly: If you change the color after all content is rendered, the swath of new color obscures the content until a reload of the window. The safest, backward- compatible scripted way of setting document color properties is to compose the content of a frame or window by script and set the
tag color attributes dynamically when document.write()puts the content into the window. Values for all color properties can be either the common HTML hexadecimal triplet value (for example, #00FF00 ) or any of the Netscape color names. Internet Explorer recognizes these plain language color names, as well. But also be aware that some colors work only when the user has the monitor set to 16- or 24-bit color settings. If you are scripting exclusively for IE4+ and NN6, you should use the document. body object to access these properties. On the Example on the CD with Listing 18-1 CD-ROM Related Items: body.aLink, body.bgColor, body.link, body.text, body.vLink properties. anchors Value: Array of anchor objects Read-Only NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . . . Anchor objects (described in Chapter 21) are points in an HTML document marked with tags. Anchor objects are referenced in URLs by a hash value between the page URL and anchor name. Like other object properties that contain a list of nested objects, the document.anchors property (notice the plural) document.anchorsSearching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.