JScript

JScript is Microsoft's dialect of the ECMAScript standard[2] that is used in Microsoft's Internet Explorer.

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.[3] 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[4] 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
Jscript icon.gif
DeveloperMicrosoft
First appeared1996
Stable release
9.0 / March 2011
Typing disciplineDynamic, weak, duck
OSMicrosoft Windows
Filename extensions.js, .jse, .wsf, .wsc (.htm, .html, .asp)[1]
Websitemsdn.microsoft.com/library/hbxc2t98.aspx
Major implementations
Active Scripting, JScript .NET

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.[5]

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. However, 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.[6] Although, the default type value for the script element in Internet Explorer is JavaScript, while JScript was its alias.[7] 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.[8] As of October 2017, Microsoft MSDN pages for scripting in Internet Explorer are being redirected there as well.[9] This information may not include JScript specific objects, such as Enumerator, which are listed in the JavaScript language reference on Microsoft Docs.[10] Those provide additional features that are not included in the ECMA Standards, whether they are supported in the Edge browser or its predecessor.[11]

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.

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”.[12]

Version Date Introduced with[13] Based on[note 1] Similar JavaScript version
1.0 Aug 1996 Internet Explorer 3.0 Netscape JavaScript 1.0
2.0 Jan 1997 Windows IIS 3.0 Netscape JavaScript 1.1
3.0 Oct 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 edition 1.3
5.0 Mar 1999 Internet Explorer 5.0 ECMA-262 2nd edition 1.4
5.1 Internet Explorer 5.01 ECMA-262 2nd edition 1.4
5.5 Jul 2000 Internet Explorer 5.5 & Windows CE 4.2 ECMA-262 3rd edition 1.5
5.6 Oct 2001 Internet Explorer 6.0 & Windows CE 5.0 ECMA-262 3rd edition 1.5
5.7 Nov 2006 Internet Explorer 7.0 ECMA-262 3rd edition + ECMA-327 (ES-CP)[note 3] 1.5
5.8 Mar 2009 Internet Explorer 8.0 & Internet Explorer Mobile 6.0 ECMA-262 3rd edition + ECMA-327 (ES-CP) + JSON (RFC 4627)3 1.5
9.0 Mar 2011 Internet Explorer 9.0 (64-bit) ECMA-262 5th edition 1.8.1

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

JScript .NET

JScript .NET is a Microsoft .NET implementation of JScript. It is a CLS 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.

Version Platform Date Introduced with Based on
7.0 Desktop CLR 1.0 2002-01-05 Microsoft .NET Framework 1.0 ECMA-262 3rd edition[note 4]
7.1 Desktop CLR 1.1 2003-04-01 Microsoft .NET Framework 1.1 ECMA-262 3rd edition[note 4]
8.0 Desktop CLR 2.0 2005-11-07 Microsoft .NET Framework 2.0 ECMA-262 3rd edition[note 4]
10.0 Desktop CLR 4.0 2010-08-03 Microsoft .NET Framework 4.0 ECMA-262 3rd edition[note 4]

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 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,[14] as does JavaScript.
  2. ^ Microsoft said JScript 3.0 was "the first scripting language to fully conform to the ECMA-262 standard".[15]
  3. ^ 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.
  4. ^ a b c d JScript .NET is "being developed in conjunction with ECMAScript Edition 4".[16]

References

  1. ^ "Types of Script Files". Msdn.microsoft.com. Retrieved 2012-08-17.
  2. ^ "JScript (ECMAScript3)". Msdn.microsoft.com. Retrieved 2012-08-17.
  3. ^ "What Is WSH?". Msdn.microsoft.com. Retrieved 2012-08-17.
  4. ^ What is JScript 10.0?
  5. ^ Douglas Crockford, The JavaScript Programming Language
  6. ^ "The World of JScript, JavaScript, ECMAScript". Blogs.msdn.microsoft.com. Retrieved 2017-10-21.
  7. ^ "script element". Msdn.microsoft.com. Retrieved 2017-10-16.
  8. ^ "Microsoft-Edge Dev-Guide". Docs.microsoft.com. Retrieved 2017-10-18.
  9. ^ "Documenting the Web Together". Blogs.windows.com. Retrieved 2017-10-18.
  10. ^ "Javascript Language Reference (Microsoft Docs)". Docs.microsoft.com. Retrieved 2017-10-18.
  11. ^ "JavaScript Objects (Microsoft Docs)". Docs.microsoft.com. Retrieved 2017-10-18.
  12. ^ "What's New in ASP.NET 4.5 and Visual Web Developer 11 Beta: The Official Microsoft ASP.NET Site".
    "What's New for ASP.NET 4.5 and Web Development in Visual Studio 11 Beta".
  13. ^ Version Information (Windows Scripting - JScript), Microsoft, retrieved 2010-05-31
  14. ^ Microsoft JScript Features - Non-ECMA (Windows Scripting - JScript), Microsoft, retrieved 2010-05-31
  15. ^ 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
  16. ^ What Is JScript .NET?, Microsoft

External links

Chakra (JScript engine)

Chakra is a JScript engine developed by Microsoft for its 32-bit version of the Internet Explorer 9 (IE9) web browser.

The JScript engine is developed as closed source proprietary software. Microsoft has developed a different JavaScript engine based on the JScript, for the newer Microsoft Edge browser (also called Chakra). The Chakra JavaScript engine has been open-sourced under the MIT license.

Chakra (JavaScript engine)

Chakra is a JavaScript engine developed by Microsoft for its Microsoft Edge web browser. It is a fork of the JScript engine used in Internet Explorer. Like the Edge layout engine and unlike previous versions in Internet Explorer the declared intention is that it will reflect the "Living Web". On December 5, 2015, it was announced that core components of Chakra will be open-sourced as ChakraCore.

Conditional comment

Conditional comments are conditional statements interpreted by Microsoft Internet Explorer versions 5 through 9 in HTML source code. Conditional comments can be used to provide and hide code to and from Internet Explorer. Conditional comments are no longer supported in IE10 and IE11.

Conditional comments in HTML first appeared in Microsoft's Internet Explorer 5 browser, although support has now been deprecated. In Internet Explorer 10, HTML conditional comments are not supported when the page is in standards mode (document mode 10). JScript conditional comments were introduced in Internet Explorer 4 and they continue to be supported in Internet Explorer 10, in standards mode or compatibility mode.

Dynamic Language Runtime

The Dynamic Language Runtime (DLR) from Microsoft runs on top of the Common Language Runtime (CLR) and provides computer language services for dynamic languages. These services include:

A dynamic type system, to be shared by all languages using the DLR services

Dynamic method dispatch

Dynamic code generation

Hosting APIThe DLR is used to implement dynamic languages on the .NET Framework, including the IronPython and IronRuby projects.

Because the dynamic language implementations share a common underlying system, it should be easier for them to interact with one another. For example, it should be possible to use libraries from any dynamic language in any other dynamic language. In addition, the hosting API allows interoperability with statically typed CLI languages like C# and Visual Basic .NET.

ECMAScript

ECMAScript (or ES)

is a scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262. It was created to standardize JavaScript, so as to foster multiple independent implementations. JavaScript has remained the best-known implementation of ECMAScript since the standard was first published, with other well-known implementations including JScript and ActionScript. ECMAScript is commonly used for client-side scripting on the World Wide Web, and it is increasingly being used for writing server applications and services using Node.js.

HTML Components

HTML Components (HTCs) are a legacy technology used to implement components in script as Dynamic HTML (DHTML) "behaviors" in the Microsoft Internet Explorer web browser. Such files typically use an .htc extension and the "text/x-component" MIME type.An HTC is typically an HTML file (with JScript / VBScript) and a set of elements that define the component. This helps to organize behavior encapsulated in script modules that can be attached to parts of a Webpage DOM.

Index of JavaScript-related articles

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

JS-1

JS-1, JS1, or variant, may refer to:

JS-1 heavy tank, Josef Stalin 1 Soviet WWII tank

Ligier JS1, 1969-1970 sportscar from Ligier

ECMAscript 1.0 (JS1.0), JavaScript standard, see JavaScript

JScript 1.0 (MS JS 1.0), Microsft Javascript variant, see JScript

Oldsmobile Jetstar I (JS1) 1960s sedan

Jonker JS-1 Revelation, sailplane

JS1 (phylum), a candidatus phylum of bacteria now called afribacteria

JScript.Encode

JScript.Encode is a method created by Microsoft used to encode both server and Client-side JavaScript or VB Script source code in order to protect the source code from copying. JavaScript code is used for creating dynamic web content on many websites, with the source code easily viewable, so this was meant to protect the code.

The encoding is a simple polyalphabetic substitution using three alphabets.

JScript .NET

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

The primary differences between JScript and JScript .NET can be summarized as follows:

Firstly, JScript is a scripting language, and as such programs (or more suggestively, scripts) can be executed without the need to compile the code first. This is not the case with the JScript .NET command-line compiler, since this next-generation version relies on the .NET Common Language Runtime (CLR) for execution, which requires that the code be compiled to Common Intermediate Language (CIL), formerly called Microsoft Intermediate Language (MSIL), code before it can be run. Nevertheless, JScript .NET still provides full support for interpreting code at runtime (e.g., via the Function constructor or the eval function) and indeed the interpreter can be exposed by custom applications hosting the JScript .NET engine via the VSA interfaces.

Secondly, JScript has a strong foundation in Microsoft's ActiveX/COM technologies, and relies primarily on ActiveX components to provide much of its functionality (including database access via ADO, file handling, etc.), whereas JScript .NET uses the .NET Framework to provide equivalent functionality. For backwards-compatibility (or for where no .NET equivalent library exists), JScript .NET still provides full access to ActiveX objects via .NET / COM interop using both the ActiveXObject constructor and the standard methods of the .NET Type class.

Although the .NET Framework and .NET languages such as C# and Visual Basic .NET have seen widespread adoption, JScript .NET has never received much attention, by the media or by developers. It is not supported in Microsoft's premier development tool, Visual Studio .NET. However, ASP.NET supports JScript .NET.

JavaScript

JavaScript (), often abbreviated as JS, is a high-level, interpreted programming language that conforms to the ECMAScript specification. JavaScript has curly-bracket syntax, dynamic typing, prototype-based object-orientation, and first-class functions.

Alongside HTML and CSS, JavaScript is one of the core technologies of the World Wide Web. JavaScript enables interactive web pages and is an essential part of web applications. The vast majority of websites use it, and major web browsers have a dedicated JavaScript engine to execute it.

As a multi-paradigm language, JavaScript supports event-driven, functional, and imperative (including object-oriented and prototype-based) programming styles. It has APIs for working with text, arrays, dates, regular expressions, and the DOM, but the language itself does not include any I/O, such as networking, storage, or graphics facilities. It relies upon the host environment in which it is embedded to provide these features.

Initially only implemented client-side in web browsers, JavaScript engines are now embedded in many other types of host software, including server-side in web servers and databases, and in non-web programs such as word processors and PDF software, and in runtime environments that make JavaScript available for writing mobile and desktop applications, including desktop widgets.

The terms Vanilla JavaScript and Vanilla JS refer to JavaScript not extended by any frameworks or additional libraries. Scripts written in Vanilla JS are plain JavaScript code.Although there are similarities between JavaScript and Java, including language name, syntax, and respective standard libraries, the two languages are distinct and differ greatly in design. JavaScript was influenced by programming languages such as Self and Scheme. The JSON serialization format, used to store data structures in files or transmit them across networks, is based on JavaScript.

List of CLI languages

CLI languages are computer programming languages that are used to produce libraries and programs that conform to the Common Language Infrastructure (CLI) specifications. With some notable exceptions, most CLI languages compile entirely to the Common Intermediate Language (CIL), an intermediate language that can be executed using an implementation of CLI such as the Common Language Runtime (CLR, a part of the Microsoft .NET Framework and .NET Core), Mono, or Portable.NET. Some of these languages also require the Dynamic Language Runtime (DLR).

As the program is being executed, the CIL code is just-in-time compiled (and cached) to the machine code appropriate for the architecture on which the program is running. This step can be omitted manually by caching at an earlier stage using an "ahead of time" compiler such as Microsoft's ngen.exe and Mono's "-aot" option.

List of ECMAScript engines

An ECMAScript engine is a program that executes source code written in a version of the ECMAScript language standard, for example, JavaScript.

These are new generation ECMAScript engines for web browsers, all implementing just-in-time compilation (JIT) or variations of that idea. The performance benefits for just-in-time compilation make it much more suitable for web applications written in JavaScript.

Carakan: A JavaScript engine developed by Opera Software ASA, included in the 10.50 release of the Opera web browser, until switching to V8 with Opera 15 (released in 2013).

Chakra (JScript9): A JScript engine used in Internet Explorer. It was first previewed at MIX 10 as part of the Internet Explorer 9 Platform Preview.

Chakra: A JavaScript engine used in Microsoft Edge.

SpiderMonkey: A JavaScript engine in Mozilla Gecko applications, including Firefox. The engine currently includes the IonMonkey compiler and OdinMonkey optimization module, has previously included the TraceMonkey compiler (first javascript JIT) and JägerMonkey.

JavaScriptCore: A JavaScript interpreter and JIT originally derived from KJS. It is used in the WebKit project and applications such as Safari. Also known as Nitro, SquirrelFish and SquirrelFish Extreme.

Tamarin: An ActionScript and ECMAScript engine used in Adobe Flash.

V8: A JavaScript engine used in Google Chrome, Node.js, and V8.NET.

Nashorn: A JavaScript engine used in Oracle Java Development Kit (JDK) since version 8.

iv, ECMAScript Lexer / Parser / Interpreter / VM / method JIT written in C++

CL-JavaScript: Can compile JavaScript to machine language on Common Lisp implementations that compile to machine languageThe following engines use runtime interpreters, which do not compile into native machine code and generally run more slowly:

Continuum: A self-interpreter that supports older drafts of the ECMAScript 2015 specification. Uniquely, the engine is implemented in ECMAScript 3, which made it possible to run ES2015 in browsers as old as IE6.

Futhark: The ECMAScript engine of the Opera web browser versions 9.50 to 10.10.

InScript: An obsolete proprietary library used for iCab 2 and 3.

JScript: The engine that is used in Internet Explorer for versions up to IE9, and one component of the Trident layout engine.

KJS: The engine used in Konqueror, and one component of KHTML, a predecessor to JavaScriptCore.

Linear B: The ECMAScript engine of the Opera web browser versions 7.0 to 9.50, exclusive.

Narcissus: JavaScript implemented in JavaScript (a meta-circular evaluator), intended to run in another JavaScript engine, of theoretical and educational nature only.

JS-Interpreter A lightweight JavaScript interpreter implemented in JavaScript with step-by-step execution.

QtScript: Originally developed by Trolltech, now owned by The Qt Company. It provides QObject integration with JavaScriptCore.

Rhino: One of several JavaScript engines from Mozilla, using the Java platform.

YAJI: An ECMAScript engine based on the FESI implementation by Jean-Marc Lugrin in 1999, using the Java platform, currently being developed to support the latest standards (ECMAScript spec. 262, v5.1).

Duktape: A small footprint, easily embeddable Ecmascript E5/E5.1 engine.

The Kinoma Platform, an ECMAScript 6 runtime environment and framework. This is one of the first runtimes to correctly implement almost all of the ECMAScript 6 specification, currently unmaintained.

Moddable successor of Kinoma Platform, currently active project and aims to support more recent versions of ECMAScript.

Jsish: A JavaScript interpreter with builtin SQLite, JSON, WebSocket, and ZVFS support.

Websocket.js: An embeddable Javascript engine with HTTP/Websocket support.

Espruino: A very small footprint interpreter specifically for microcontrollers. Can run in less than 8 kB of RAM by executing from source (rather than bytecode).

MuJS: A lightweight ECMAScript interpreter library, designed for embedding in other software to extend them with scripting capabilities. Originally developed for MuPDF.

V7: Part of the Smart.js platform; claims to be the world's smallest JavaScript engine.

Tiny-JS: A minimal JavaScript interpreter written in C++.

JerryScript: A lightweight JavaScript engine by Samsung for microcontrollers with less than 64 KB RAM.

GNU Guile features an ECMAScript interpreter as of version 1.9

njs: A lightweight JavaScript interpreter optimized for web server scripting and fastest VM context creation; used in nginx.

MSXML

Microsoft XML Core Services (MSXML), now legacy, was a set of services that allowed 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.

Microsoft Script Debugger

Microsoft Script Debugger is relatively minimal debugger for Windows Script Host-supported scripting languages, such as VBScript and JScript. Its user interface allows the user to set breakpoints and/or step through execution of script code line by line, and examine values of variables and properties after any step. In effect, it provides a way for developers to see script code behavior as it runs, thus eliminating much of the guess-work when things don't quite work as intended.

Microsoft considers it to be deprecated in favor of the more sophisticated Microsoft Script Editor (MSE.EXE), an optional tool included in Microsoft Office 2000 through Office 2007. Also, Internet Explorer 8 comes with a different, tightly integrated JScript debugger part of the Internet Explorer Developer Tools.

VBScript

VBScript ("Microsoft Visual Basic Scripting Edition") is an Active Scripting language developed by Microsoft that is modeled on Visual Basic. It allows Microsoft Windows system administrators to generate powerful tools for managing computers with error handling, subroutines, and other advanced programming constructs. It can give the user complete control over many aspects of their computing environment.

VBScript uses the Component Object Model to access elements of the environment within which it is running; for example, the FileSystemObject (FSO) is used to create, read, update and delete files. VBScript has been installed by default in every desktop release of Microsoft Windows since Windows 98; in Windows Server since Windows NT 4.0 Option Pack; and optionally with Windows CE (depending on the device it is installed on).

A VBScript script must be executed within a host environment, of which there are several provided with Microsoft Windows, including: Windows Script Host (WSH), Internet Explorer (IE), and Internet Information Services (IIS). Additionally, the VBScript hosting environment is embeddable in other programs, through technologies such as the Microsoft Script Control (msscript.ocx).

WinWrap Basic

WinWrap Basic (WWB) by Polar Engineering, Inc. is a third-party macro language based on Visual Basic used with programmes of various types which its vendor touts as an alternative to ActiveX (e.g. VBScript, JScript, PerlScript, Rexx-based WSH engines and others), Visual Basic for Applications, and VSTA for this purpose. The WWB software package is used in conjunction with Microsoft development tools including Visual Studio, Visual Studio.NET, and the ActiveX scripting engines. The default file extension for programmes written in this language is .wwb

WWB 10 has Windows Scripting Host functionality, i.e. it contains a scripting engine similar to the default and third-party language implementations for WSH. This engine is able to access both the .NET framework and the Component Object Model.

The current version, 10.01, is available for different combinations of OS and platform. At this time there are four types of WWB, those being WWB.NET for the .NET object model (used with Visual Studio.NET 2005 and 2008 and Vista), .WWB-COM for the COM object model (Visual Studio and Visual Studio.NET earlier versions), both of which are used with all Windows 32 and 64-bit operating systems from Windows 95 to Windows Vista; the other two packages are for Windows CE and PocketPC & Windows Mobile. Earlier versions of WWB ran under Windows 3.1 and ostensibly OS/2 Warp 3 as well.

WWB is integrated into many software packages including most categories of PC and server software (e.g. earlier versions of Host Explorer, which now uses two proprietary scripting languages, Hummingbird QuickScript and Hummingbird Basic) as well as software used to run various types of equipment like mass spectrometers and other lab equipment.

Windows Script File

A Windows Script File (WSF) is a file type used by the Microsoft Windows Script Host. It allows mixing the scripting languages JScript and VBScript within a single file, or other scripting languages such as Perl, Object REXX, Python, or Kixtart if installed by the user. These types of scripts may also be used to link many other external scripts together using a src parameter on the " or "