array('UTF-8', 'en'), 'content' => array('index.html', 'Contents'), 'home' => array('index.html', 'Core JavaScript Guide 1.5'), 'this' => array('preface.html#1001665', 'About this Book'), 'prev' => array('index.html', 'Core JavaScript Guide 1.5'), 'next' => array('intro.html#1009367', 'JavaScript Overview'), 'toc' => array( array('preface.html#1001665', 'About this Book', 0), array('preface.html#1003152', 'New Features in this Release', 1), array('preface.html#1001681', 'What You Should Already Know', 1), array('preface.html#1003515', 'JavaScript Versions', 1), array('preface.html#1001692', 'Where to Find JavaScript Information', 1), array('preface.html#1001745', 'Document Conventions', 1), array('intro.html#1009367', 'Chapter 1. JavaScript Overview', 0), /* array('intro.html#1009369', 'What Is JavaScript?', 1), array('intro.html#1012569', 'JavaScript and Java', 1), array('intro.html#1013654', 'JavaScript and the ECMA Specification', 1), array('intro.html#1013678', 'Relationship Between JavaScript and ECMA Versions', 2), array('intro.html#1013717', 'JavaScript Documentation vs. the ECMA Specification', 2), array('intro.html#1013722', 'JavaScript and ECMA Terminology', 2), array('intro.html#1023167', 'New Features in this Release', 1), */ array('partcore.html#999869', 'Part 1. Core Language Features', 0), array('ident.html#1008302', 'Chapter 2. Values, Variables, and Literals', 0), /* array('ident.html#1008306', 'Values', 1), array('ident.html#1008319', 'Data Type Conversion', 2), array('ident.html#1008330', 'Variables', 1), array('ident.html#1008338', 'Declaring Variables', 2), array('ident.html#1012659', 'Evaluating Variables', 2), array('ident.html#1009822', 'Variable Scope', 2), array('ident.html#1012963', 'Constants', 1), array('ident.html#1013090', 'Literals', 1), array('ident.html#1011655', 'Array Literals', 2), array('ident.html#1012095', 'Boolean Literals', 2), array('ident.html#1009427', 'Floating-Point Literals', 2), array('ident.html#1008351', 'Integers', 2), array('ident.html#1009450', 'Object Literals', 2), array('ident.html#1008368', 'String Literals', 2), array('ident.html#1009568', 'Unicode', 1), array('ident.html#1009571', 'Unicode Compatibility with ASCII and ISO', 2), array('ident.html#1009576', 'Unicode Escape Sequences', 2), array('ident.html#1009690', 'Displaying Characters with Unicode', 2), */ array('expr.html#1008302', 'Chapter 3. Expressions and Operators', 0), /* array('expr.html#1010338', 'Expressions', 1), array('expr.html#1008323', 'Operators', 1), array('expr.html#1008336', 'Assignment Operators', 2), array('expr.html#1010037', 'Comparison Operators', 2), array('expr.html#1008458', 'Arithmetic Operators', 2), array('expr.html#1008505', 'Bitwise Operators', 2), array('expr.html#1008622', 'Logical Operators', 2), array('expr.html#1008684', 'String Operators', 2), array('expr.html#1008688', 'Special Operators', 2), array('expr.html#1008750', 'Operator Precedence', 2), */ array('regexp.html#1010922', 'Chapter 4. Regular Expressions', 0), /* array('regexp.html#1008311', 'Creating a Regular Expression', 1), array('regexp.html#1010689', 'Writing a Regular Expression Pattern', 1), array('regexp.html#1008325', 'Using Simple Patterns', 2), array('regexp.html#1008327', 'Using Special Characters', 2), array('regexp.html#1008498', 'Using Parentheses', 2), array('regexp.html#1008506', 'Working With Regular Expressions', 1), array('regexp.html#1008659', 'Using Parenthesized Substring Matches', 2), array('regexp.html#1008681', 'Executing a Global Search, Ignoring Case, and Considering Multiline Input', 2), array('regexp.html#1013064', 'Examples', 1), array('regexp.html#1008695', 'Changing the Order in an Input String', 2), array('regexp.html#1008713', 'Using Special Characters to Verify Input', 2), */ array('stmtsov.html#1008303', 'Chapter 5. Statements', 0), /* array('stmtsov.html#1016322', 'Block Statement', 1), array('stmtsov.html#1008319', 'Conditional Statements', 1), array('stmtsov.html#1008323', 'if...else Statement', 2), array('stmtsov.html#1008329', 'switch Statement', 2), array('stmtsov.html#1008340', 'Loop Statements', 1), array('stmtsov.html#1008347', 'for Statement', 2), array('stmtsov.html#1008359', 'do...while Statement', 2), array('stmtsov.html#1008366', 'while Statement', 2), array('stmtsov.html#1010474', 'label Statement', 2), array('stmtsov.html#1008389', 'break Statement', 2), array('stmtsov.html#1008402', 'continue Statement', 2), array('stmtsov.html#1008417', 'Object Manipulation Statements', 1), array('stmtsov.html#1008452', 'for...in Statement', 2), array('stmtsov.html#1008460', 'with Statement', 2), array('stmtsov.html#1008468', 'Comments', 1), array('stmtsov.html#1011537', 'Exception Handling Statements', 1), array('stmtsov.html#1014198', 'The throw Statement', 2), array('stmtsov.html#1012168', 'The try...catch Statement', 2), */ array('fcns.html#1008302', 'Chapter 6. Functions', 0), /* array('fcns.html#1008305', 'Defining Functions', 1), array('fcns.html#1013889', 'Calling Functions', 1), array('fcns.html#1012766', 'Using the arguments Array', 1), array('fcns.html#1008357', 'Predefined Functions', 1), array('fcns.html#1008364', 'eval Function', 2), array('fcns.html#1009925', 'isFinite Function', 2), array('fcns.html#1008370', 'isNaN Function', 2), array('fcns.html#1008379', 'parseInt and parseFloat Functions', 2), array('fcns.html#1008394', 'Number and String Functions', 2), array('fcns.html#1012712', 'escape and unescape Functions', 2), */ array('obj.html#1008302', 'Chapter 7. Working with Objects', 0), /* array('obj.html#1008312', 'Objects and Properties', 1), array('obj.html#1008327', 'Creating New Objects', 1), array('obj.html#1008330', 'Using Object Initializers', 2), array('obj.html#1008361', 'Using a Constructor Function', 2), array('obj.html#1008392', 'Indexing Object Properties', 2), array('obj.html#1008397', 'Defining Properties for an Object Type', 2), array('obj.html#1008406', 'Defining Methods', 2), array('obj.html#1008434', 'Using this for Object References', 2), array('obj.html#1018325', 'Defining Getters and Setters', 2), array('obj.html#1008445', 'Deleting Properties', 2), array('obj.html#1010352', 'Predefined Core Objects', 1), array('obj.html#1008453', 'Array Object', 2), array('obj.html#1008502', 'Boolean Object', 2), array('obj.html#1008512', 'Date Object', 2), array('obj.html#1008590', 'Function Object', 2), array('obj.html#1008620', 'Math Object', 2), array('obj.html#1008686', 'Number Object', 2), array('obj.html#1018247', 'RegExp Object', 2), array('obj.html#1008731', 'String Object', 2), */ array('obj2.html#1013803', 'Chapter 8. Details of the Object Model', 0), /* array('obj2.html#1008342', 'Class-Based vs. Prototype-Based Languages', 1), array('obj2.html#1011360', 'Defining a Class', 2), array('obj2.html#1011368', 'Subclasses and Inheritance', 2), array('obj2.html#1011428', 'Adding and Removing Properties', 2), array('obj2.html#1011444', 'Summary of Differences', 2), array('obj2.html#1008388', 'The Employee Example', 1), array('obj2.html#1008404', 'Creating the Hierarchy', 1), array('obj2.html#1008465', 'Object Properties', 1), array('obj2.html#1008468', 'Inheriting Properties', 2), array('obj2.html#1008483', 'Adding Properties', 2), array('obj2.html#1008499', 'More Flexible Constructors', 1), array('obj2.html#1008567', 'Property Inheritance Revisited', 1), array('obj2.html#1008570', 'Local versus Inherited Values', 2), array('obj2.html#1008594', 'Determining Instance Relationships', 2), array('obj2.html#1008610', 'Global Information in Constructors', 2), array('obj2.html#1008628', 'No Multiple Inheritance', 2), */ array('partlc.html#999869', 'Part 2. Working with LiveConnect', 0), array('lc.html#1008305', 'Chapter 9. LiveConnect Overview', 0), /* array('lc.html#1013074', 'Working with Wrappers', 1), array('lc.html#1014290', 'JavaScript to Java Communication', 1), array('lc.html#1029016', 'The Packages Object', 2), array('lc.html#1029099', 'Working with Java Arrays', 2), array('lc.html#1029045', 'Package and Class References', 2), array('lc.html#1029446', 'Arguments of Type char', 2), array('lc.html#1033594', 'Handling Java Exceptions in JavaScript', 2), array('lc.html#1008480', 'Java to JavaScript Communication', 1), array('lc.html#1030717', 'Using the LiveConnect Classes', 2), array('lc.html#1037078', 'Data Type Conversions', 1), array('lc.html#1037090', 'JavaScript to Java Conversions', 2), array('lc.html#1037422', 'Java to JavaScript Conversions', 2), */ array('glossary.html#996904', 'Glossary', 0), array('ix.html#573', 'Index', 0) ))); manual_header(); ?>


About this Book


JavaScript is Netscape's cross-platform, object-based scripting language. This book explains everything you need to know about using core JavaScript.

This preface contains the following sections:



New Features in this Release

For a summary of JavaScript 1.5 features, see "New Features in this Release" on page 18. Information on these features has been incorporated in this manual.



What You Should Already Know



This book assumes you have the following basic background: 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    Abbreviations of 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 (this book) provides information about the core JavaScript language and its objects.

  • The Core JavaScript Reference 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.
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.html

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.html 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.