1263Chapter 47 .Cross-Browser Dynamic HTML (Florida web design) Issues Version checking

1263Chapter 47 .Cross-Browser Dynamic HTML Issues Version checking here is quite specific. First of all, it intentionally limits access to browsers whose versions come back as Version 4. This code, written when the browsers were still at Version 4, was remarkably prescient. My concern at the time was that DHTML was so volatile that it was unknown if future browser versions would be backward compatible with the code to be run inside branches governed by the two global variables. As it turned out, NN6 (whose navigator.appVersion reports 5) is not backward compatible with the layer structure of NN4, so that locking the NN4 branches to NN4 became a good thing. On the IE side, the navigator. appVersion property continues to report 4, even through IE5.5, which is backward compatible with IE4. Thus, any branch dedicated to IE4 executes under this scheme and remains syntactically accurate. Another aspect of the flag-setting script I should mention is that the example provides no escape route for browsers that aren t level 4 or aren t either Navigator or Internet Explorer (should there be a level 4 browser from another brand). In a production environment, I would either prefilter access to the page or redirect ill- equipped users to a page that explains why they can t view the page. In the structure of the above script, redirection would have to be made in two places, as follows: var isNav4, isIE4 if (parseInt(navigator.appVersion) == 4) { if (navigator.appName == Netscape ) { isNav4 = true } else if (navigator.appVersion.indexOf( MSIE ) != -1) { isIE4 = true } else { location = sorry.html } } else { location = sorry.html } Later in this chapter, I discuss the issue of designing DHTML pages that degrade gracefully in pre-DHTML browsers. With the global variables defined in the document (and unsupported browsers redirected elsewhere), you can use them as condition values in branching statements that address an object according to the reference appropriate for each platform. For example, to change the visibilityproperty of an object named instructions, you use the flags as follows: if (isNav4) { document.instructions.visibility = hidden } else { document.all.instructions.style.visibility = hidden } As the browser DOMs evolve, expand, and fragment, inline branching becomes increasingly less practical. With so many permutations of DOM according to browser brand, browser version, and operating system, you can drive yourself crazy trying to accommodate them all and maintain the code going forward. This approach also eliminates from consideration any non-NN or non-IE browser (such as Opera), which may have the capabilities needed to play your DHTML scripts. This approach also limits the possibility that future browsers with higher navigator.appVersion values can take advantage of your scripts.
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.

Leave a Reply