This preprocessor constant provides the version 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 version of JScript expected is version 5.0 and you do get the value 5 reported by this directive.
If you intend to hide this directive inside some comments, it must be done like this:
/*@_jscript_version @*/
As is the case with the @_jscript_build directive, this one may be affected by the installation history of your workstation.
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. Due to the component nature of Microsoft browsers and interpreters, the same is true on the Windows platform and you can very easily find the versions of browser and JScript integerpreter have diverged as a result of installing another application that may upgrade some shared components.
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 or vice versa. Test the thing you need to know about and do not assume that the browser and interpreter are directly related to one another.
The version history tables suggest they are related but this simply lists the versions of JScript that were shipped as part of the browser install kit for a fresh and complete installation.
See also: | Pre-processing, Pre-processing - /*@ ... @*/ |
Prev | Home | Next |
Pre-processing - @_jscript_build | Up | Pre-processing - @_mac |
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. |