Navigation
  • Home
  • Recent
  • Most Active
  • Popular
  • Blog
  • Credits
  • RSS
  •   Interaction
  • Register
  • Statistics
  •   Help
  • Suggestions
  • Contact Us
  • How to Edit
  • Help



  • [Edit]


    ECMAScript is a scripting programming language, standardized by Ecma International in the ECMA-262 specification. The language is widely used on the web, and is often referred to as JavaScript or JScript, although those two languages are extensions of the ECMA-262 standard.

        ECMAScript
            History
            Versions
            Dialects
            Version correspondence
            Fourth edition
            ECMAScript variables
            See also

    top

    History
    In December 1995 Sun Microsystems and Netscape Communications Corporation introduced * JavaScript. In March 1996 Netscape Communications Corporation released Netscape Navigator 2.0, which featured support for JavaScript. Due to the de facto success of JavaScript as a client-side scripting language for web pages, Microsoft developed a "roughly" compatible language known as JScript, which was included in Internet Explorer 3.0, released in August 1996.

    Netscape submitted the JavaScript specification to Ecma International for standardization; the work on the specification, ECMA-262, began in November 1996. The first edition of ECMA-262 was adopted by the ECMA General Assembly of June 1997.

    ECMAScript is the name of the scripting language standardized in ECMA-262. Both JavaScript and JScript technologies aim to be compatible with ECMAScript, while providing additional features not described in the ECMA specification.

    top

    Versions
    There are three editions of ECMA-262 published, and the work on the fourth edition is in progress.



    In June 2004 Ecma International published ECMA-357 standard, defining an extension to ECMAScript, known as E4X (ECMAScript for XML).

    top

    Dialects
    ECMAScript is supported in many applications, especially web browsers. The binding with DOM is added for manipulating the document.



    Note (1): Gecko 1.8.1 has partial support of E4X * and a few other features, see New in JavaScript 1.7.

    Note (2): Microsoft claims that JScript 8.0 supports "almost all of the features of the ECMAScript Edition 3 Language Specification" but does not list the unsupported features.

    Note (3): In addition to supporting ECMA-262 edition 3, ActionScript 2 also included support of properties, methods, and mechanisms that were proposed in early draft specifications of as yet unseen versions of ECMAScript. It remains to be seen if ActionScript will stay in sync with future changes to the ECMAScript specifications.

    Note (4): As stated by OpenLaszlo, it partially implements edition 3 of ECMA-262 *

    The Mozilla implementations, (SpiderMonkey in the C programming language and Rhino in the Java programming language), are used in several third-party programs, including Konfabulator and the Macintosh system-level scripting language JavaScript OSA.

    Apple's Safari uses JavaScriptCore which is based on the KDE KJS library.

    top

    Version correspondence
    The following table is based on * and *; items on the same line are approximately the same language.



    top

    Fourth edition
    The current work on the fourth edition of ECMAScript has received some criticism, as there is thought to be a concerted effort by the organization to change the language from a prototype-based programming language into a more traditional class-based programming one, in essence, changing the very nature of how JavaScript treats relationships between objects. JavaScript is often championed by prototype-based language advocates, as it is the best known language with this object-oriented feature. ActionScript version 2.0 is an example of a ECMAScript implementation which is already more class-based than prototype-based. It will be formally defined in terms of Standard ML of New Jersey, a member of the ML programming language family*; ML offers strong support for many desired or proposed features such as tail recursion.*

    It is also noted that the fourth edition has been very long awaited. The third edition was released in 1999, since that time, interactive web applications have grown tremendously in complexity, while the scripting language has remained essentially frozen.

    top

    ECMAScript variables

    Variables in ECMAScript are defined by using the var operator (short for variable), followed
    by the variable name, such as:
    var test = "hi";
    In this example, the variable test is declared and given an initialization value of "hi" (a string).
    Because ECMAScript is dynamically typed, the interpreter automatically creates a string value for test
    without any explicit type declaration. You can also define two or more variables using the same var
    statement:
    var test = "hi", test2 = "hola";
    The previous code defines the variable test to have a value of "hi" and the variable test2 to have a
    value of "hola". Variables using the same var statement don’t have to be of the same type, however, as
    shown in the following:
    var test = "hi", age = 25;
    This example defines test (yet again) in addition to another variable named age that is set to the value
    of 25. Even though test and age are two different data types, this is perfectly legal in ECMAScript.
    Unlike Java, variables in ECMAScript do not require initialization (they are actually initialized behind
    the scenes, which I discuss later). Therefore, this line of code is valid:
    var test;
    Also unlike Java, variables can hold different types of values at different times; this is the advantage of
    loosely typed variables. A variable can be initialized with a string value, for instance, and later on be set
    to a number value, like this:
    var test = 'hi';
    alert(test); //outputs 'hi'
    //do something else here
    test = 55;
    alert(test); //outputs '55'
    This code outputs both the string and the number values without incident (or error). You can edit JavaScript by JavaScript editor. As mentioned previously,
    it is best coding practice for a variable to always contain a value of the same type throughout
    its use.

    top

    See also
     
    Search more:
     

       
    Source Privacy License Download Contact Us Atlas
    Scientus.org Dictionary (Yet Another Wiki) RC : 1.39
    This article is licensed under the GNU Free Documentation License [copyleft]. It uses material from the Wikipedia article "ECMAScript". link