AJAX - The Complete Reference

(avery) #1

552 Part IV: Appendixes



  • Parameters are passed to functions by value except in the case of composite types
    like arrays or objects, which are passed by reference.

  • JavaScript is a prototype-based object-oriented language (not class-based in its
    current incarnation).

  • There are four kinds of available objects: built-in objects, host (browser) objects,
    document objects, and user-defined objects.

  • JavaScript supports functional style and higher order programming styles.

  • Features such as browser interaction, document manipulation, and even basic I/O
    are provided by related objects and are not directly built-in to the language.

  • Standard security policy defines scripts to be able to interact only with server-side
    scripts from the same origin (serving domain) and restricts access to local resources
    without explicit grant by the user. However, we note that scripts can be combined
    from different resources and will share the same name space which leads to the
    security concerns presented in Chapter 7.


Language Versions and Conformance

A common criticism voiced about JavaScript is the wide range of versions. This is a
legitimate concern for JavaScript developers looking for the widest range of compatibility.
Table A-1 presents the current versions of ECMAScript that JavaScript implementations
may conform to, as well as notes on the emerging Edition 4.
Each browser vendor has evolved its implementation of JavaScript a bit differently.
Netscape/Mozilla/Firefox often serves as the reference implementation, at least for the core
language. The evolution of JavaScript in this family of browsers is detailed in Table A-2.

TABLE A-1 Standard Versions of JavaScript

Standard Version Description
ECMAScript Edition 1 First standardized version of JavaScript, based loosely on
JavaScript 1.0 and JScript 1.0.
ECMAScript Edition 2 Standard version correcting errors within Edition 1 (and some
very minor improvements).
ECMAScript Edition 3 More advanced language standard based on ECMAScript Edition 2.
Includes regular expressions and exception handling. In
widespread use.
ECMAScript for XML (E4X) ECMA-357 (www.ecma-international.org/publications/standards/
Ecma-357.htm) is a modification of ECMAScript that adds native
XML support to the language. It is supported in Firefox 1.5+ and
later versions of ActionScript. Given the focus on ECMAScript
Version 4 and JavaScript 2.0, this is likely to be
a little discussed version of the language.
ECMAScript Edition 4 New standard, still unfinished at the time of this writing. Likely
to include features such as optional static typing, packages and
namespaces, generators and iterators, JSON, and class-based OOP.
Free download pdf