views:

2575

answers:

11

I have always wondered what the heck is the difference between JScript and JavaScript.

+3  A: 

JScript is the Microsoft implementation of Javascript

James Boother
+10  A: 

From Wikipedia: http://en.wikipedia.org/wiki/Jscript

JScript is the Microsoft dialect of the ECMAScript scripting 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.

Microsoft uses the name JScript for its implementation to avoid trademark issues (JavaScript is a trademark of Sun Microsystems).

casademora
A: 

JScript is Microsoft's implementation of the ECMAScript specification. JavaScript is the Mozilla implementation of the specification.

Thomas Owens
+1  A: 

This is pretty well documented in several places easily found using Google, e.g. What is the difference between JavaScript, JScript and ECMAScript?

mdb
+3  A: 

According to this article:

  • JavaScript is a scripting language developed by Netscape Communications designed for developing client and server Internet applications. Netscape Navigator is designed to interpret JavaScript embedded into Web pages. JavaScript is independent of Sun Microsystem's Java language.

  • Microsoft JScript is an open implementation of Netscape's JavaScript. JScript is a high-performance scripting language designed to create active online content for the World Wide Web. JScript allows developers to link and automate a wide variety of objects in Web pages, including ActiveX controls and Java programs. Microsoft Internet Explorer is designed to interpret JScript embedded into Web pages.

Christophe Herreman
Open implementation?
phjr
@phrj: this is the Humpty Dumpty definition of "Open". AFAIK, it means "orthogonal".
Shog9
+1  A: 

Wikipedia has this to say about the differences.

In general JScript is an ActiveX scripting language that is probably interpreted as JavaScript by non-IE browsers.

erlando
+22  A: 

Just different names for what is really ECMAScript. John Resig has a good explanation.

Here's the full version breakdown:

  • IE 6-7 support JScript 5 (which is equivalent to ECMAScript 3, JavaScript 1.5)
  • IE 8 supports JScript 6 (which is equivalent to ECMAScript 3, JavaScript 1.5 - more bug fixes over JScript 5)
  • Firefox 1.0 supports JavaScript 1.5 (ECMAScript 3 equivalent)
  • Firefox 1.5 supports JavaScript 1.6 (1.5 + Array Extras + E4X + misc.)
  • Firefox 2.0 supports JavaScript 1.7 (1.6 + Generator + Iterators + let + misc.)
  • Firefox 3.0 supports JavaScript 1.8 (1.7 + Generator Expressions + Expression Closures + misc.)
  • The next version of Firefox will support JavaScript 1.9 (1.8 + To be determined)
  • Opera supports a language that is equivalent to ECMAScript 3 + Getters and Setters + misc.
  • Safari supports a language that is equivalent to ECMAScript 3 + Getters and Setters + misc.
Zach
+4  A: 

As far as I can tell, two things:

  1. ActiveXObject constructor
  2. The idiom f(x) = y, which is roughly equivalent to f[x] = y.
Patrick
The `f(x) = y` idiom bugs me the most! Why, oh why didn't they just go with `f[x] = y`...
Ates Goral
+2  A: 

Javascript, the language, came first, from Netscape.

Microsoft reverse engineered Javascript and called it JScript to avoid trademark issues with Sun. (Netscape and Sun were partnered up at the time, so this was less of an issue)

The languages are identical, both are dialects of ECMA script, the after-the-fact standard.

Although the languages are identical, since JScript runs in Internet Explorer, it has access to different objects exposed by the browser (such as ActiveXObject)

Alan Storm
Neither the languages are really identical, as outlined in another post.
EFraim
+1  A: 

I was trying to provide an answer to http://stackoverflow.com/questions/901550/what-are-the-javascript-functions-syntax-which-are-not-supported-by-ie

I'm sure it's already been pointed out, but IE, you can't use const keyword to declare variables:

const MY_CONSTANT = 10;

dplante
A: 

j script is client side scripting language and required web browser to execute while java script is a server side scripting language required web server to execute....that's a basic diffrence between j script and java script.....