This preprocessor constant returns the build number of the interpreter (but not the browser) in which the script is running.
For example, in version 5.0 of MSIE for Macintosh, the browser build number is 2022 but the JScript build number reported by this pre-processor directive is 3715.
If you intend to hide this directive inside some comments, it must be done like this:
/*@_jscript_build @*/
Oddly enough, in version 4.5 of MSIE, the value reported is also 3715 even though the build number of the browser is 0408 and is therefore much older.
Because both versions of the browser were tested in the same machine, it is possible that by installing the MSIE 5 browser, some components of the browser are stored in the System folder. These may well have overwritten components that the version 4.5 browser was using and so you need to be aware of the possibility of MSIE browsers exhibiting odd behavior due to the way the application is factored into components. In fact this is confirmed by the fact that the @_jscript_version directive reports JScript 5 from within MSIE 4.5 which is not correct. Other aspects of the interpreter that interact with the browser core may exhibit JScript 3 functionality. So installing MSIE 5 on a Macintosh over the top of an MSIE 4.5 yields an interesting hybrid variant of the version 4.5 browser. Performing upgrades of your browser and JScript components on a Windows platform may yield similar hybrid variants.
You should be careful that if you code for a version of something you should be testing that same thing. Don't test browser versions to conditionally execute JScript version specific code.
The Netscape Navigator browser code is contained more integrally within its own application space and you may be able to have several versions of that browser without any subtle interaction between low-level shared library modules.
You may assume the version of the interpreter tells you something useful but don't assume any other implications regarding browser versions based on the interpreter version.
See also: | Pre-processing, Pre-processing - /*@ ... @*/ |
Prev | Home | Next |
Pre-processing - @_jscript | Up | Pre-processing - @_jscript_version |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |