94 Part III . (Disney web site) Document Objects Reference This

94 Part III . Document Objects Reference This scenario requires browser version branching in several places to allow for variations in browser treatment of the features and to avoid problems with older scriptable browsers and nonscriptable browsers alike. You can (and should) per form some (if not all) of the branching via object detection, as you will see in a moment. Table 14-7 highlights the major feature requirements for this scenario and describes the browser support for each. Table 14-7 Features and Support for a Typical Middle Ground Scenario Feature Support and Approach Dynamic Styles IE4+ and NN6+ through the style property of any HTML element object Form Calculations Unless requiring Y2K date compliance or regular expression parsing of input, should work with all scriptable browsers without any branching required Dynamic Content IE4+ and NN6+ support Dynamic HTML content within a cell, but MS and W3C object models require different ways of changing a table cell s content. (Or you can use the nonstandard, but convenient, innerHTML property of the cell.) For older scriptable browsers, the cell should contain a text box to display the results; for nonscriptable browsers, the cell should contain a button that submits the form to a server CGI to process the calculation and return a new page with the results. Dynamic styles For dynamic styles, both the IE4+ and W3C object models provide access to style sheet settings via the style property of any HTML element. This simplifies matters because you can wrap modifications to style properties inside if clauses that check for the existence of the styleproperty for the specified object: function hilite(elem) { if (elem.style) { elem.style.fontWeight = bold } } If the event handler that triggers the change can be localized to the affected element (for example, an onMouseOverevent handler for a SPAN element surrounding some text), then the event doesn t fire in browsers that don t also support the style property. (By good fortune, browsers that implement the styleproperty also expose all elements to the object model.) To compensate for the differences in object references between the IE4+ and W3C models, you can pass the object as a parameter to event handler functions:
From our experience, we can recommend PHP5 Web Hosting services, if you need affordable webhost to host and run your web application.

Leave a Reply