Which Javascript version(s) does IE8 supports?

34,276

Solution 1

Well, actually the IE implementation is called JScript, JavaScript(TM) is the implementation of Mozilla.

JScript and JavaScript are two ECMAScript-based dialects.

JavaScript 1.5 conforms with the ECMAScript 3rd Edition Standard, the subsequent versions, JS 1.6, 1.7 and 1.8 introduce language features that are out of that standard edition, often called Mozilla Extensions.

That's why JScript doesn't have any of these features, because they are not part of the ECMA Standard.

Solution 2

This test taken from here returns 1.3 in my Internet Explorer 8 64-bit.

<SCRIPT Language="JavaScript1.3">
jsver = "1.3";
</SCRIPT>
<SCRIPT Language="JavaScript1.4">
jsver = "1.4";
</SCRIPT>
<SCRIPT Language="JavaScript1.5">
jsver = "1.5";
</SCRIPT>
<SCRIPT Language="JavaScript1.6">
jsver = "1.6";
</SCRIPT>
<SCRIPT Language="JavaScript1.7">
jsver = "1.7";
</SCRIPT>
<SCRIPT Language="JavaScript1.8">
jsver = "1.8";
</SCRIPT>

<BODY>

<SCRIPT LANGUAGE="JavaScript">
document.write("<B>Your browser supports JavaScript version " + jsver + ".</B>")
</SCRIPT>

</body>
</html>

Solution 3

IE doesn't support JavaScript at all. “JavaScript” specifically refers to Mozilla's implementation of the ECMAScript standard. This standard was originally derived from Netscape/Mozilla's work on the language, but they have since diverged. IE's implementation of ECMAScript is called “JScript”, and it does not support many of the extensions Mozilla have made.

The version of ECMAScript IE aims for is the Third Edition standard, which is also version JavaScript 1.5 was aimed at, which is why they're considered similar. The JavaScript engines of Opera, Safari and Chrome all target this same version; whilst all the implementations have bugs that mean they don't quite exactly meet the spec, in general ECMAScript Third Edition is a solid baseline for what works today.

The next version of ECMAScript is the Fifth Edition, which was standardised recently. All browsers are picking up features from this spec and it is hoped it will become as widely-supported in the future. It does not align to any particular “JavaScript” version; it notably picks up some useful String and Array methods that were previously in JavaScript 1.5, but you won't find most of Mozilla's syntactical extensions to JS in the standard.

Solution 4

Yes, that is true (at least as far as which language features are supported). You can easily check this using some Javascript 1.6 code:

alert([1,2,3].indexOf(2));

IE 8 throws an error.

Note that IE 8 might support some of the features added in later versions of Javascript. IE contains a lot of stuff outside the standards, so it's likely that some of it happens to be the same as the later additions.

Share:
34,276
MatteoSp
Author by

MatteoSp

Solution architect and senior developer in a variety of applications for the enterprise environments. Particularly interested in system integration, application servers implementations, service orientation and cloud computing. Very passionate and naturally devoted to extreme quality solutions. Specialties: technological leadership, architecture, complex system design and implementation, system integration, technology adoption

Updated on February 01, 2020

Comments

  • MatteoSp
    MatteoSp over 4 years

    According to Wikipedia, IE8 only supports Javascript 1.5. So they are saying IE8 completely ignores Javascript versions 1.6, 1.7, 1.8 and 1.9.

    Should I trust? Is it true?

  • Matthew Flaschen
    Matthew Flaschen about 13 years
    ECMAscript 5 was published in December 2009 (several months before this answer), incorporating many of these new features into the standard.
  • nobody
    nobody over 10 years
    Does IE8 support ECMAscript 5 then?
  • Potherca
    Potherca almost 10 years
    @BenNelson Broadly speaking, NO. Source: kangax.github.io/compat-table/es5/#ie8