Previous     Contents     Index     Next     
Core JavaScript Reference 1.5



About this Book


JavaScript is Netscape's cross-platform, object-based scripting language. This book is a reference manual for the core JavaScript language.

This preface contains the following sections:



New Features in this Release

JavaScript version 1.5 provides the following new features and enhancements:

  • Runtime errors. Runtime errors are now reported as exceptions.

  • Number formatting enhancements. Number formatting has been enhanced to include Number.prototype.toExponential, Number.protoytpe.toFixed and Number.prototype.toPrecision methods. See page 127, page 128, and page 129.

  • Regular expression enhancements:

    • Greedy quantifiers — +, *, ? and {} — can now be followed by a ? to force them to be non-greedy. See the entry for ? on page 148.

    • Non-capturing parentheses, (?:x) can be used instead of capturing parentheses(x). When non-capturing parentheses are used, matched subexpressions are not available as back-references. See the entry for (?:x) on page 148.

    • Positive and negative lookahead assertions are supported. Both assert a match depending on what follows the string being matched. See the entries for (?=) and (?!) on page 148.

    • The m flag has been added to specify that the regular expression should match over multiple lines. See page 146.

  • Conditional function declarations. Functions can now be declared inside an if clause. See page 221.

  • Function expressions. Functions can now be declared inside an expression. See page 254.

  • Multiple catch clauses. Multiple catch clauses in a try...catch statement are supported. See page 231.

  • Constants. Readonly, named constants are supported. This feature is available only in the C implementation of JavaScript. See page 215.

  • Getters and Setters. JavaScript writers can now add getters and setters to their objects. This feature is available only in the C implementation of JavaScript. See Defining Getters and Setters in Chapter 7 of the Core JavaScript Guide for information about this feature.



What You Should Already Know

This book assumes you have the following basic background:

  • A general understanding of the Internet and the World Wide Web (WWW).

  • Good working knowledge of HyperText Markup Language (HTML).

Some programming experience with a language such as C or Visual Basic is useful, but not required.



JavaScript Versions



Each version of Navigator supports a different version of JavaScript. To help you write scripts that are compatible with multiple versions of Navigator, this manual lists the JavaScript version in which each feature was implemented.

The following table lists the JavaScript version supported by different Navigator versions. Versions of Navigator prior to 2.0 do not support JavaScript.


Table 1    JavaScript and Navigator versions

JavaScript version

Navigator version

JavaScript 1.0  

Navigator 2.0  

JavaScript 1.1  

Navigator 3.0  

JavaScript 1.2  

Navigator 4.0-4.05  

JavaScript 1.3  

Navigator 4.06-4.7x  

JavaScript 1.4  

-  

JavaScript 1.5  

Navigator 6.0

Mozilla (open source browser)  

Each version of the Netscape Enterprise Server also supports a different version of JavaScript. To help you write scripts that are compatible with multiple versions of the Enterprise Server, this manual uses an abbreviation to indicate the server version in which each feature was implemented.


Table 2    JavaScript and Netscape Enterprise Server versions

Abbreviation

Enterpriser Server version

NES 2.0  

Netscape Enterprise Server 2.0  

NES 3.0  

Netscape Enterprise Server 3.0  



Where to Find JavaScript Information



The core JavaScript documentation includes the following books:

  • The Core JavaScript Guide provides information about the core JavaScript language and its objects.

  • The Core JavaScript Reference (this book) provides reference material for the core JavaScript language.

If you are new to JavaScript, start with the Core JavaScript Guide. Once you have a firm grasp of the fundamentals, you can use the Core JavaScript Reference to get more details on individual objects and statements.

DevEdge, Netscape's online developer resource, contains information that can be useful when you're working with JavaScript. The following URLs are of particular interest:



Document Conventions

JavaScript applications run on many operating systems; the information in this book applies to all versions. File and directory paths are given in Windows format (with backslashes separating directory names). For Unix versions, the directory paths are the same, except that you use slashes instead of backslashes to separate directories.

This book uses uniform resource locators (URLs) of the following form:

http://server.domain/path/file.htmll

In these URLs, server represents the name of the server on which you run your application, such as research1 or www; domain represents your Internet domain name, such as netscape.com or uiuc.edu; path represents the directory structure on the server; and file.htmll represents an individual file name. In general, items in italics in URLs are placeholders and items in normal monospace font are literals. If your server has Secure Sockets Layer (SSL) enabled, you would use https instead of http in the URL.

This book uses the following font conventions:

  • The monospace font is used for sample code and code listings, API and language elements (such as method names and property names), file names, path names, directory names, HTML tags, and any text that must be typed on the screen. (Monospace italic font is used for placeholders embedded in code.)

  • Italic type is used for book titles, emphasis, variables and placeholders, and words used in the literal sense.

  • Boldface type is used for glossary terms.


Previous     Contents     Index     Next     
Copyright © 2000 Netscape Communications Corp. All rights reserved.

Last Updated September 28, 2000