156Part IIIDocument Objects ReferenceDealing with beta browsersIf you have crafted a skillfully scripted Web page or site, you may be concerned when a pre- release (or beta) version of a browser available to the public causes script errors or othercompatibility problems to appear on your page. Do yourself a favor don t overreact tobugs and errors that occur in prerelease browser versions. If your code is well written, itshould work with any new generation of browser. If the code doesn t work correctly, con- sider the browser to be buggy. Report the bug (preferably with a simplified test case scriptsample) to the browser maker. The exception to the it s a beta bug rule arose in the transition from NN4 to the new Mozillaengine (first released as NN6). As you learn in Chapter 14, a conscious effort to eliminate aproprietary NN4 feature (the tag and corresponding scriptable object) caused manyNN4 scripts to break on Moz1 betas (and final release). Had scripters gone to report the prob- lem to the new browsers developer (Mozilla), they would have learned of the policy change, and planned for the new implementation. It is extremely rare for a browser to eliminate a pop- ular feature so quickly, but it can happen. It is often difficult to prevent yourself from getting caught up in browser makers enthusiasmfor a new release. But remember that a prerelease version is not a shipping version. Userswho visit your page with prerelease browsers should know that there may be bugs in thebrowser. That your code does not work with a prerelease version is not a sin, nor is it worthlosing sleep over. Just be sure to connect with the browser s maker either to find out if theproblem will continue in the final release or to report the bug so the problem doesn t make itinto the release version. The Evaluator Sr. In Chapter 6, you were introduced to a slimmed-down version of The Evaluator Jr., which pro- vides an interactive workbench to experiment with expression evaluation and object inspec- tion. At this point, you should meet The Evaluator Sr., a tool you will use in many succeedingchapters to help you learn both core JavaScript and DOM terminology. Figure 13-1 shows the top part of the page. Two important features differentiate this full ver- sion from the Jr. version in Chapter 6. IE Browser Version HeadachesAs described more fully in the discussion of the navigatorobject in Chapter 38 on theCD-ROM, your scripts can easily determine which browser is the one running the script. However, the properties that reveal the version don t always tell the whole story about Internet Explorer. As you can see in detail in Chapter 38 on the CD-ROM, the navigator.appVersionproperty forIE5, 5.5, and 6 for Windows reports version 4 (the same as IE4). You can still sniff for versions5 and 6 (you can find the designation MSIE 5or MSIE6in the navigator.userAgentproperty), but the process is not as straightforward as it could be. The best advice is to be vigilant whennew browsers come on the scene or adopt object detection techniques in your scripts.
This entry was posted
on Sunday, September 2nd, 2007 at 4:02 am and is filed under Tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.