The version of JScript that is available to you depends on whether the JScript code will run on the client in a Web browser or on the server by using the .NET Framework. If the code is contained in a Visual Studio application or is within a command-line application, it is considered server-side code.
When you write client-side scripts that run in the script engine of a browser, the running script detects the engine version. Once the engine version is known, a script written in a compatible version of JScript can be run. For more information, see Detecting Browser Capabilities.
The following table lists the version of Microsoft JScript implemented by host applications.
Host application | JScript version |
|---|
Internet Explorer 3.0 | 1.0 |
Internet Information Server 3.0 | 2.0 |
Internet Explorer 4.0 | 3.0 |
Internet Information Server 4.0 | 3.0 |
Visual Studio 6.0 | 4.0 |
Internet Explorer 5.0 | 5.0 |
Internet Explorer 5.01 | 5.1 |
Windows 2000 | 5.1 |
Internet Explorer 5.5 | 5.5 |
Internet Explorer 6.0 | 5.6 |
Windows XP (through SP2) | 5.6 |
Internet Explorer 7.0 | 5.7 |
Windows XP SP3 | 5.7 |
Windows Vista | 5.7 |
Internet Explorer 8.0 | 5.8 |
When you write code for a server-side application or a command-line application, the version of JScript that is available to you depends on the .NET Framework version that you are targeting. The following table lists the version of Microsoft JScript that is implemented by each version of the .NET Framework.
Visual Studio version | .NET Framework version | JScript version |
|---|
Visual Studio .NET 2002 | .NET Framework 1.0 | JScript 7.0 (JScript .NET 2002) |
Visual Studio .NET 2003 | .NET Framework 1.1 | JScript 7.0 (JScript .NET 2003) |
Visual Studio 2005 | .NET Framework 2.0 | JScript 8.0 |
Visual Studio 2008 | .NET Framework 3.5 | JScript 8.0 |
Note: |
|---|
The version number reported by the ScriptEngineMajorVersion function and the @_jscript_version conditional compilation variable is always numeric. This allows numeric comparisons to be made with the version number. For version .NET applications, the version reported is 7.x, not .NET. Engines that report a version number of 7.x or higher can compile JScript 8.0 code. |