JScript

Last updated
JScript
Jscript icon.gif
Developer Microsoft
First appeared1996;28 years ago (1996)
Stable release
9.0 / March 2011
Typing discipline Dynamic, weak, duck
OS Microsoft Windows
Filename extensions .js , .jse, .wsf , .wsc ( .htm , .html , .hta , .asp ) [1]
Website learn.microsoft.com/en-us/previous-versions/hbxc2t98(v=vs.85)
Major implementations
Active Scripting, JScript .NET

JScript is Microsoft's legacy [2] dialect of the ECMAScript standard [3] that is used in Microsoft's Internet Explorer web browser and HTML Applications, and as a standalone Windows scripting language.

Contents

JScript is implemented as an Active Scripting engine. This means that it can be "plugged in" to OLE Automation applications that support Active Scripting, such as Internet Explorer, Active Server Pages, and Windows Script Host. [4] It also means such applications can use multiple Active Scripting languages, e.g., JScript, VBScript or PerlScript.

JScript was first supported in the Internet Explorer 3.0 browser released in August 1996. Its most recent version is JScript 9.0, included in Internet Explorer 9.

JScript 10.0 [5] is a separate dialect, also known as JScript .NET, which adds several new features from the abandoned fourth edition of the ECMAScript standard. It must be compiled for .NET Framework version 2 or version 4, but static type annotations are optional.

JScript has been criticized for being insecure and having multiple security bugs "exploited by nation-state actors", [6] leading Microsoft to add an option to disable it. [7]

Comparison to JavaScript

As explained by Douglas Crockford in his talk titled The JavaScript Programming Language on YUI Theater,

[Microsoft] did not want to deal with Sun Microsystems about the trademark issue, and so they called their implementation JScript. A lot of people think that JScript and JavaScript are different but similar languages. That's not the case. They are just different names for the same language, and the reason the names are different was to get around trademark issues. [8]

However, JScript supports conditional compilation, which allows a programmer to selectively execute code within block comments. This is an extension to the ECMAScript standard that is not supported in other JavaScript implementations, thus making the above statement not completely true, although conditional compilation is no longer supported in Internet Explorer 11 Standards mode.

Other internal implementation differences between JavaScript and JScript, at some point in time, are noted on the Microsoft Developer Network (MSDN). [9] The default type value for the script element in Internet Explorer is JavaScript, while JScript was its alias. [10] In an apparent transition from JScript to JavaScript, online, the Microsoft Edge Developer Guide refers to the Mozilla MDN web reference library as its definitive documentation. [11] As of October 2017, Microsoft MSDN pages for scripting in Internet Explorer are being redirected there as well. [12] This information may not include JScript specific objects, such as Enumerator, which are listed in the JavaScript language reference on Microsoft Docs. [13] Those provide additional features that are not included in the ECMA Standards, whether they are supported in the Edge browser or its predecessor. [14]

Versions

JScript (COM Classic)

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 before IE9, as well as in classic ASP, Windows Script Host scripts and other Automation environments.

JScript is sometimes referred to as "classic JScript" or "Active Scripting JScript" to differentiate it from newer .NET-based versions.

Some versions of JScript are available for multiple versions of Internet Explorer and Windows. For example, JScript 5.7 was introduced with Internet Explorer 7.0 and is also installed for Internet Explorer 6.0 with Windows XP Service Pack 3, while JScript 5.8 was introduced with Internet Explorer 8.0 and is also installed with Internet Explorer 6.0 on Windows Mobile 6.5.

Microsoft's implementation of ECMAScript 5th Edition in Windows 8 Consumer Preview is called JavaScript and the corresponding Visual Studio 11 Express Beta includes a "completely new", full-featured JavaScript editor with IntelliSense enhancements for HTML5 and ECMAScript 5 syntax, "VSDOC" annotations for multiple overloads, simplified DOM configuration, brace matching, collapsible outlining and "go to definition". [15]

VersionDateIntroduced with [16] Based on [note 1] Similar JavaScript version
1.0Aug 1996 Internet Explorer 3.0 Netscape JavaScript 1.0
2.0Jan 1997 Windows IIS 3.0Netscape JavaScript1.1
3.0Oct 1997 Internet Explorer 4.0 ECMA-262 1st edition [note 2] 1.3
4.0 Visual Studio 6.0 (as part of Visual InterDev)ECMA-262 1st edition1.3
5.0Mar 1999 Internet Explorer 5.0 ECMA-262 2nd edition1.4
5.1Internet Explorer 5.01ECMA-262 2nd edition1.4
5.5Jul 2000Internet Explorer 5.5 & Windows CE 4.2ECMA-262 3rd edition1.5
5.6Oct 2001 Internet Explorer 6.0 & Windows CE 5.0ECMA-262 3rd edition1.5
5.7Nov 2006 Internet Explorer 7.0 ECMA-262 3rd edition [19] + ECMA-327 (ES-CP) [note 3] 1.5
5.8Mar 2009 Internet Explorer 8.0 & Internet Explorer Mobile 6.0 ECMA-262 3rd edition + ECMA-327 (ES-CP) [note 3] + JSON (RFC 4627)1.5
11.0Jun 2024 Windows 11 version 24H2 (JScript 9 Legacy, designed as a compatible drop-in replacement for JScript 5.8, but not 100% compatible [20] )1.5

JScript is also available on Windows CE (included in Windows Mobile, optional in Windows Embedded CE). The Windows CE version lacks Active Debugging.

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.

While it is primarily designed to be used within Silverlight and ASP.NET at this time, it can also easily be embedded within any .NET application. [21]

Two builds of Managed JScript exist: one for the Desktop CLR and one for the Silverlight CoreCLR

VersionDateIntroduced withBased onPlatform
1.0.0.02007 ASP.NET Futures (July 2007 preview)ECMA-262 3rd editionDesktop CLR 2.0
1.1.20625.02007 Microsoft Silverlight 1.1 Alpha (Sep 2007 refresh)ECMA-262 3rd edition CoreCLR 1.1

Managed JScript is not supported in the .NET Compact Framework.

(Source: files versions of Microsoft.JScript.Runtime.dll in ASP.NET Futures and Silverlight 1.1 folders)

JScript "Chakra" (JsRT)

JScript "Chakra" is based on the JScript (COM classic) version, but it has been redesigned to improve performance in Internet Explorer 9 [22] at the expense of proper Active Scripting engine compatibility. It requires a specific Microsoft JavaScript Hosting (JsRT) API for proper use. Therefore, it is installed side by side with JScript 5.x and is only used by Internet Explorer 9 and later as well as JsRT hosts, while other Active Scripting hosts keep using the 5.x version when requesting the JScript engine.

VersionDateIntroduced with [23] Based on [24] Similar JavaScript version
Chakra 9.0Mar 2011 Internet Explorer 9.0 ECMA-262 5th edition1.8.1
Chakra 10.0Sep 2012 Internet Explorer 10.0 ECMA-262 5.1 edition
Chakra 11.0Oct 2013 Internet Explorer 11.0 ECMA-262 6th edition
Chakra EdgeJul 2015 Edge / Windows 10 ECMA-262 5.1 to 9 (2018) edition

(kept up to date without engine versioning)

There are two versions of the Chakra JsRT engine. The original one was used by Internet Explorer 9 and later, and is sometimes referred to as "jscript9.dll" or "legacy Chakra engine", and a second one used by Microsoft Edge Legacy browser and sometimes referred to as "new Chakra engine", "Edge engine" or "Chakra.dll". Both Chakra JsRT versions can be used by other applications using the JsRT API and can be installed side by side. [25]

There is also a COM Classic version of Chakra internally called "JScript 9 Legacy" (provided by jscript9Legacy.dll), introduced with Windows 11 24H2, which brings back compatibility with Active Scripting hosts and intended as a compatible drop-in replacement for JScript 5.8. Although largely compatible with the original JScript 5.8, there are notable breaking differences. [26]

See separate page about new Chakra (Edge) engine.

JScript .NET (CLI)

JScript .NET is a Microsoft .NET implementation of JScript. It is a CLI language and thus inherits 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 places it more as an upgrade path for classic ASP using classic JScript than as a new first-class language.

VersionPlatformDateIntroduced withBased on
7.0Desktop CLR 1.02002-01-05 Microsoft .NET Framework 1.0ECMA-262 3rd edition [note 4]
7.1Desktop CLR 1.12003-04-01 Microsoft .NET Framework 1.1ECMA-262 3rd edition [note 4]
8.0Desktop CLR 2.02005-11-07 Microsoft .NET Framework 2.0ECMA-262 3rd edition [note 4]
10.0Desktop CLR 4.02010-08-03 Microsoft .NET Framework 4.0ECMA-262 3rd edition [note 4]

JScript .NET is not supported in the .NET Compact Framework.[ citation needed ]

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 follow their corresponding Visual Studio versions.

.NET Framework 3.0 and 3.5 are built on top of 2.0 and do not include the newer JScript.NET release (version 10.0 for .NET Framework 4.0).

(Source: file version of jsc.exe JScript.NET compiler and Microsoft.JScript.dll installed with .NET Framework)

See also

Notes

  1. JScript supports various features not specified in the ECMA standard, [17] as does JavaScript.
  2. Microsoft said JScript 3.0 was "the first scripting language to fully conform to the ECMA-262 standard". [18]
  3. 1 2 JScript 5.7 includes an implementation of the ECMAScript Compact Profile (ECMA-327) which turns off features not required by the ES-CP when using the "JScript.Compact" ProgID.[ citation needed ]
  4. 1 2 3 4 JScript .NET is "being developed in conjunction with ECMAScript Edition 4". [27]

Related Research Articles

<span class="mw-page-title-main">JavaScript</span> High-level programming language

JavaScript, often abbreviated as JS, is a programming language and core technology of the Web, alongside HTML and CSS. 99% of websites use JavaScript on the client side for webpage behavior.

<span class="mw-page-title-main">Internet Explorer</span> Web browser series by Microsoft

Internet Explorer is a retired series of graphical web browsers developed by Microsoft that were used in the Windows line of operating systems. While IE has been discontinued on most Windows editions, it remains supported on certain editions of Windows, such as Windows 10 LTSB/LTSC. Starting in 1995, it was first released as part of the add-on package Plus! for Windows 95 that year. Later versions were available as free downloads or in-service packs and included in the original equipment manufacturer (OEM) service releases of Windows 95 and later versions of Windows. Microsoft spent over US$100 million per year on Internet Explorer in the late 1990s, with over 1,000 people involved in the project by 1999. New feature development for the browser was discontinued in 2016 and ended support on June 15, 2022 for Windows 10 Semi-Annual Channel (SAC), in favor of its successor, Microsoft Edge.

VBScript is a deprecated programming language for scripting on Microsoft Windows using Component Object Model (COM) based on classic Visual Basic and Active Scripting.

<span class="mw-page-title-main">Windows API</span> Microsofts core set of application programming interfaces on Windows

The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a computer program to access the features of the Microsoft Windows operating system in which the program is running. Programs access API functionality via dynamic-link library (DLL) technology.

ECMAScript is a standard for scripting languages, including JavaScript, JScript, and ActionScript. It is best known as a JavaScript standard intended to ensure the interoperability of web pages across different web browsers. It is standardized by Ecma International in the document ECMA-262.

<span class="mw-page-title-main">Windows Script Host</span> Automation technology for Windows

The Microsoft Windows Script Host (WSH) is an automation technology for Microsoft Windows operating systems that provides scripting abilities comparable to batch files, but with a wider range of supported features. This tool was first provided on Windows 95 after Build 950a on the installation discs as an optional installation configurable and installable by means of the Control Panel, and then a standard component of Windows 98 and subsequent and Windows NT 4.0 Build 1381 and by means of Service Pack 4. The WSH is also a means of automation for Internet Explorer via the installed WSH engines from IE Version 3.0 onwards; at this time VBScript became means of automation for Microsoft Outlook 97. The WSH is also an optional install provided with a VBScript and JScript engine for Windows CE 3.0 and following and some third-party engines including Rexx and other forms of Basic are also available.

JScript .NET is a .NET programming language developed by Microsoft.

ECMAScript for XML (E4X) was an extension to ECMAScript to add native support for XML. The goal was to provide a simpler alternative to the DOM interface for accessing XML documents. E4X added XML as a primitive data structure to allow for faster access and better support within the language.

Active Scripting is the technology used in Windows to implement component-based scripting support. It is based on OLE Automation and allows installation of additional scripting engines in the form of COM modules.

In Microsoft Windows applications programming, OLE Automation is an inter-process communication mechanism created by Microsoft. It is based on a subset of Component Object Model (COM) that was intended for use by scripting languages – originally Visual Basic – but now is used by several languages on Windows. All automation objects are required to implement the IDispatch interface. It provides an infrastructure whereby applications called automation controllers can access and manipulate shared automation objects that are exported by other applications. It supersedes Dynamic Data Exchange (DDE), an older mechanism for applications to control one another. As with DDE, in OLE Automation the automation controller is the "client" and the application exporting the automation objects is the "server".

Microsoft XML Core Services (MSXML) are set of services that allow applications written in JScript, VBScript, and Microsoft development tools to build Windows-native XML-based applications. It supports XML 1.0, DOM, SAX, an XSLT 1.0 processor, XML schema support including XSD and XDR, as well as other XML-related technologies.

An HTML Application (HTA) is a Microsoft Windows program whose source code consists of HTML, Dynamic HTML, and one or more scripting languages supported by Internet Explorer, such as VBScript or JScript. The HTML is used to generate the user interface, and the scripting language is used for the program logic. An HTA executes without the constraints of the internet browser security model; in fact, it executes as a "fully trusted" application.

<span class="mw-page-title-main">Internet Explorer 9</span> Web browser for Windows released in 2011

Internet Explorer 9 or IE9 is the ninth major version of the Internet Explorer web browser for Windows. It was released by Microsoft on March 14, 2011, as the successor to Internet Explorer 8. Microsoft released Internet Explorer 9 as a major out-of-band version that was not tied to the release schedule of any particular version of Windows, unlike previous versions. It is the first version of Internet Explorer not to be bundled with a Windows operating system, although some OEMs have installed it with Windows on their PCs. Internet Explorer 9 was the last version to be called Windows Internet Explorer. The software was rebranded simply as Internet Explorer starting with the release of Internet Explorer 10.

Component Object Model (COM) is a binary-interface technology for software components from Microsoft that enables using objects in a language-neutral way between different programming languages, programming contexts, processes and machines.

Chakra was a free and open-source JavaScript engine developed by Microsoft for its Microsoft Edge Legacy web browser. It is a fork of the same-named JScript engine used in Internet Explorer. Like the EdgeHTML browser engine, the declared intention was that it would reflect the "Living Web". The core components of Chakra were open-sourced as ChakraCore. In 2021, Microsoft terminated support for the engine, citing its transition to a Chromium based engine for Edge. Support has been transferred to the community, where it remains inactive.

Windows Runtime (WinRT) is a platform-agnostic component and application architecture first introduced in Windows 8 and Windows Server 2012 in 2012. It is implemented in C++ and officially supports development in C++, Rust/WinRT, Python/WinRT, JavaScript-TypeScript, and the managed code languages C# and Visual Basic (.NET) (VB.NET).

This is a list of articles related to the JavaScript programming language.

ECMAScript is a JavaScript standard developed by Ecma International. Since 2015, major versions have been published every June.

References

  1. "Types of Script Files". Msdn.microsoft.com. 24 October 2011. Retrieved 2012-08-17.
  2. "Disabling legacy scripting engine JScript in Internet Explorer". TECHCOMMUNITY.MICROSOFT.COM. 2020-10-13. Retrieved 2021-11-15.
  3. "JScript (ECMAScript3)". Msdn.microsoft.com. 24 October 2011. Retrieved 2012-08-17.
  4. "What Is WSH?". Msdn.microsoft.com. 24 October 2011. Retrieved 2012-08-17.
  5. What is JScript 10.0?
  6. Cimpanu, Catalin. "Microsoft adds option to disable JScript in Internet Explorer". ZDNet. Retrieved 2021-11-15.
  7. "Option to disable JScript execution in Internet Explorer". support.microsoft.com. Retrieved 2021-11-15.
  8. Douglas Crockford, The JavaScript Programming Language
  9. "The World of JScript, JavaScript, ECMAScript". Blogs.msdn.microsoft.com. 15 August 2007. Retrieved 2017-10-21.
  10. "script element". Msdn.microsoft.com. Retrieved 2017-10-16.
  11. "Microsoft-Edge Dev-Guide". Docs.microsoft.com. Retrieved 2017-10-18.
  12. "Documenting the Web Together". Blogs.windows.com. 18 October 2017. Retrieved 2017-10-18.
  13. "Javascript Language Reference (Microsoft Docs)". Docs.microsoft.com. Retrieved 2017-10-18.
  14. "JavaScript Objects (Microsoft Docs)". Docs.microsoft.com. Retrieved 2017-10-18.
  15. "What's New in ASP.NET 4.5 and Visual Web Developer 11 Beta: The Official Microsoft ASP.NET Site". 13 May 2022.
    "What's New for ASP.NET 4.5 and Web Development in Visual Studio 11 Beta". 12 May 2015.
  16. Version Information (Windows Scripting – JScript), Microsoft, retrieved 2010-05-31
  17. Microsoft JScript Features – Non-ECMA (Windows Scripting – JScript), Microsoft, retrieved 2010-05-31
  18. Microsoft Embraces ECMA Internet Scripting Standard; Delivers Industry's First ECMA-Compliant Scripting Language, JScript 3.0, In Key Microsoft Products, Microsoft, 1997-06-30, archived from the original on 2009-01-12
  19. Lakshman, Pratap. "JScript Deviations from ES3" (PDF). The Register. Situation Publishing / Microsoft. Retrieved 9 February 2020.
  20. "Windows 11 22H2 has a different way of using the JS engine? - Microsoft Q&A".
  21. (Source: JScript Blog, Jim Hugunin's Thinking Dynamic blog, Source: Blog of Jitu)
  22. Niyogi, Shanku (18 March 2010). "The New JavaScript Engine in Internet Explorer 9". IEBlog (archives). Microsoft. Retrieved 19 February 2020.
  23. Version Information (Windows Scripting – JScript), Microsoft, retrieved 2010-05-31
  24. "Internet Explorer Standards Support Documents". Open Specifications (Microsoft Docs). Microsoft. Retrieved 19 February 2020.
  25. "Targeting Microsoft Edge vs. Legacy Engines in JsRT APIs". Microsoft Edge documentation (Microsoft Docs). Microsoft. Retrieved 19 February 2020.
  26. "Windows 11 22H2 has a different way of using the JS engine? - Microsoft Q&A".
  27. What Is JScript .NET?, Microsoft