JScript: Difference between revisions
No edit summary |
+ MS APIs template |
||
Line 165: | Line 165: | ||
[[tr:JScript]] |
[[tr:JScript]] |
||
[[zh:JScript]] |
[[zh:JScript]] |
||
{{Microsoft APIs}} |
Revision as of 04:26, 7 October 2007
JScript is the Microsoft implementation of the ECMAScript scripting programming language specification.
JavaScript (the Netscape/Mozilla implementation of the ECMA specification), JScript, and ECMAScript are very similar languages. In fact the name "JavaScript" is often used to refer to ECMAScript or JScript.
JavaScript is used on web pages for scripting, although it can be and is also used in other embedding scenarios.
- For general information about the language, its history, and uses see the JavaScript article. The article on ECMAScript has information on various dialects and implementations of ECMAScript and the history of the specification. JavaScript syntax is described in its own article. The rest of this article focuses on Microsoft implementation.
JScript is implemented as a Windows Script engine. This means that it can be "plugged in" to any application that supports Windows Script, such as Internet Explorer, Active Server Pages, and Windows Script Host. It also means that any application supporting Windows Script can use multiple languages — JScript, VBScript, Perl, and others. JScript was first supported in Internet Explorer browser 3.0 released in August 1996. As with any other Active Scripting engine, it is available through Internet Explorer, Windows Script Host, and Active Server Pages. The typical file extension of JScript source code files is .js.
The most recent version of JScript is JScript .NET, which is based on the yet-unfinished edition 4 of the ECMAScript standard, and can be compiled for the Microsoft .NET platform. JScript.NET adds several new features to ECMAScript ed. 3, such as optional static type annotations.
Versions
JScript
The original JScript is an Active Scripting engine. Like other Active Scripting languages, it is built on the COM/OLE Automation platform and provides scripting capabilities to host applications. This is the version used when hosting JScript inside a Web page displayed by Internet Explorer, in an HTML application, in classic ASP, in Windows Script Host scripts and several other Automation environments. JScript is sometimes referred to as "classic JScript" or "Active Scripting JScript" to differentiate it from newer .NET-based versions.
Version | Date | Introduced with[1] | Approx. JavaScript1 |
---|---|---|---|
1.0 | Aug 1996 | Internet Explorer 3.0 | 1.0 |
2.0 | Jan 1997 | Windows IIS 3.0 | 1.1 |
3.0 | Oct 1997 | Internet Explorer 4.0 | 1.3 |
4.0 | Visual Studio 6.0 (as part of Visual InterDev) | ||
5.0 | Mar 1999 | Internet Explorer 5.0 | < 1.5 |
5.1 | Internet Explorer 5.01 | < 1.5 | |
5.5 | Jul 2000 | Internet Explorer 5.5 | 1.5 |
5.6 | Oct 2001 | Internet Explorer 6.0 | 1.5 |
5.7 | Nov 2006 | Internet Explorer 7.0 | 1.5 |
Note (1): JScript supports various features not specified in the ECMA standard[2], as does JavaScript.
JScript is also available on Windows CE (included in Windows Mobile, optional in Windows Embedded CE). The Windows CE version lacks Active Debugging.
(Source: MSDN, WebmasterWorld Forum)
Managed JScript
Managed JScript is an implementation of JScript for the Dynamic Language Runtime, it is part of Microsoft's dynamic languages for .NET along with IronRuby, IronPython, and Dynamic Visual Basic. Unlike JScript .NET which is less dynamic than the original JScript but provides CLS compatibility, Managed JScript is designed on top of the DLR and provides the features needed for scripting scenarios. It is planned to be part of Microsoft Silverlight 1.1 and next versions of ASP.NET.
(Source: JScript Blog, Jim Hugunin's Thinking Dynamic blog, Source: Blog of Jitu)
JScript .NET
JScript .NET is a Microsoft .NET implementation of JScript, it is a CLS language and thus inherit very powerful features, but lacks many features of the original JScript language, making it inappropriate for many scripting scenarios. JScript .NET can be used for ASP.NET pages and for complete .NET applications, but the lack of support for this language in Microsoft Visual Studio place it more as an upgrade path for classic ASP using classic JScript than as a new first-class language.
Version | Date | Introduced with | Approx. JavaScript |
---|---|---|---|
7.0 | 2000-7-11 | Microsoft .NET Framework 1.0 | ? |
7.1 | ? | Microsoft .NET Framework 1.1 | ? |
8.0 | ? | Microsoft .NET Framework 2.0 | ? |
JScript .NET is not supported in the .NET Compact Framework.
Note JScript .NET versions are not related to classic JScript versions. JScript .NET is a separate product. Even though JScript .NET is not supported within the Visual Studio IDE, its versions are in sync with other .NET languages versions (C#, VB.NET, VC++) that follows their corresponding Visual Studio versions.
The .NET Framework 3.0 does not include a newer release of JScript.
(Source: file version of Microsoft.JScript.dll in each framework install)
Differences from JavaScript
This section needs expansion. You can help by adding to it. |
In addition to other internal implementation differences, JScript uses non-generational mark-and-sweep garbage collection[3] whereas JavaScript (the original implementation of which is the SpiderMonkey engine) uses a generational mark-and-sweep system.
See also
- Hello World program in JScript
- JavaScript, Originally LiveScript, it was the first implementation of this language family
- ECMAScript, the ECMA language definition standard which all implementations must at a minimum follow
- VBScript
- JScript.NET
- Active Scripting
- Windows Script File
- Windows Script Host
External links
- classic JScript documentation in the MSDN Library
- JScript .NET documentation in the MSDN Library
- JScript blog
Downloads
Latest versions of classic JScript (5.6 and 5.7) are bundled with Internet Explorer, so it is already installed and up to date on most Windows computers. For people using another browser and not installing Internet Explorer updates (which is not recommended, as IE also updates Windows core components related to HTTP and HTML rendering for Windows itself and other applications), the JScript engine is also available as part of the Windows Script package, which is the set of scripting components of Windows (containing VBScript, JScript, Windows Script Host, Windows Script Component and Windows Script Runtime).
- Windows Script 5.7 for Windows 2000
- Windows Script 5.7 for Windows XP
- Windows Script 5.7 for Windows Server 2003
The latest version for Windows 98, Me and NT4 is Windows Script 5.6, which used to be available on Microsoft Download Center but seems to have been removed when 5.7 went online. Windows Vista already contains Windows Script 5.7.
References
- ^ Microsoft Developer Network. "Version Information (JScript 5.6)". Retrieved 2007-08-12.
- ^ Microsoft Developer Network. "Microsoft JScript Features - Non-ECMA (JScript 5.6)". Retrieved 2007-08-12.
- ^ Eric Lippert. "How Do The Script Garbage Collectors Work?". Retrieved 2007-08-12.