关于

  • 版本网址缩略名: Core_JavaScript_1.5_Guide/关于
  • 版本标题: 关于
  • 版本 id: 268346
  • 创建于:
  • 创建者: Weiming
  • 是否是当前版本?
  • 评论

修订内容

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.prototype.toFixed and Number.prototype.toPrecision methods. See the Object Number page.

Regular expression enhancements
The following regular expression enhancements have been added:

Conditional function declarations
Functions can now be declared inside an if clause. See the Defining Functions page.

Function expressions
Functions can now be declared inside an expression. See the Defining Functions page.

Multiple catch clauses
Multiple catch clauses in a try...catch statement are supported. See The catch Block page.

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 the Defining Getters and Setters page.

Constants
Read only named constants are supported. This feature is available only in the C implementation of JavaScript. See the Constants page.

What You Should Already Know

This guide 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

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)

Table 1: JavaScript and Navigator versions

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.

Abbreviation Enterprise Server version
NES 2.0 Netscape Enterprise Server 2.0
NES 3.0 Netscape Enterprise Server 3.0

Table 2: Abbreviations of Netscape Enterprise Server versions

Where to find JavaScript Information

The core JavaScript documentation includes the following books:

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

{{template.PreviousNext("Core_JavaScript_1.5_Guide", "Core_JavaScript_1.5_Guide:JavaScript_Overview")}}

{{ wiki.languages( { "pl": "pl/Przewodnik_po_j\u0119zyku_JavaScript_1.5/O" } ) }}

修订版来源

<p>
</p>
<h3 name="New_Features_in_this_Release"> New Features in this Release </h3>
<p>JavaScript version 1.5 provides the following new features and enhancements:
</p><p><b>Runtime errors</b><br>
Runtime errors are now reported as exceptions.
</p><p><b>Number formatting enhancements</b><br>
Number formatting has been enhanced to include Number.prototype.toExponential, Number.prototype.toFixed and Number.prototype.toPrecision methods. See the <a href="cn/Core_JavaScript_1.5_Guide/Predefined_Core_Objects/Number_Object">Object Number</a> page.
</p><p><b>Regular expression enhancements</b><br>
The following regular expression enhancements have been added:        
</p>
<ul><li> Quantifiers — +, *, ? and {} — can now be followed by a ? to force them to be non-greedy. See the entry for ? on page <a href="cn/Core_JavaScript_1.5_Guide/Writing_a_Regular_Expression_Pattern#Using_Special_Characters">Writing a Regular Expression Pattern</a>.
</li><li> 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 <a href="cn/Core_JavaScript_1.5_Guide/Writing_a_Regular_Expression_Pattern#Using_Special_Characters">Writing a Regular Expression Pattern</a>.
</li><li> Positive and negative lookahead assertions are supported. Both assert a match depending on what follows the string being matched. See the entries for x(?=y) and x(?!y) on page <a href="cn/Core_JavaScript_1.5_Guide/Writing_a_Regular_Expression_Pattern#Using_Special_Characters">Writing a Regular Expression Pattern</a>.
</li><li> The m flag has been added to specify that the regular expression should match over multiple lines. See the <a href="cn/Core_JavaScript_1.5_Guide/Working_with_Regular_Expressions/Executing_a_Global_Search%2c_Ignoring_Case%2c_and_Considering_Multiline_Input">Executing a Global Search, Ignoring Case, and Considering Multiline Input</a> page.
</li></ul>
<p><b>Conditional function declarations</b><br>
Functions can now be declared inside an if clause. See the <a href="cn/Core_JavaScript_1.5_Guide/Defining_Functions">Defining Functions</a> page.
</p><p><b>Function expressions</b> <br>
Functions can now be declared inside an expression. See the <a href="cn/Core_JavaScript_1.5_Guide/Defining_Functions">Defining Functions</a> page.
</p><p><b>Multiple catch clauses</b><br>
Multiple catch clauses in a try...catch statement are supported. See <a href="cn/Core_JavaScript_1.5_Guide/Exception_Handling_Statements/try...catch_Statement#The_catch_Block">The catch Block</a> page.
</p><p><b>Getters and Setters</b><br>
JavaScript writers can now add getters and setters to their objects. This feature is available only in the C implementation of JavaScript. See the <a href="cn/Core_JavaScript_1.5_Guide/Creating_New_Objects/Defining_Getters_and_Setters">Defining Getters and Setters</a> page.
</p><p><b>Constants</b> <br>
Read only named constants are supported. This feature is available only in the C implementation of JavaScript. See the <a href="cn/Core_JavaScript_1.5_Guide/Constants">Constants</a> page.
</p>
<h3 name="What_You_Should_Already_Know"> What You Should Already Know </h3>
<p>This guide assumes you have the following basic background:
</p>
<ul><li> A general understanding of the Internet and the World Wide Web (WWW).
</li><li> Good working knowledge of HyperText Markup Language (HTML).<br>
</li></ul>
<p>Some programming experience with a language such as C or Visual Basic is useful, but not required.
</p>
<h3 name="JavaScript_Versions"> JavaScript Versions </h3>
<table class="fullwidth-table">
<tbody><tr>
<th>JavaScript version</th>
<th>Navigator version</th>
</tr>
<tr>
<td>JavaScript 1.0</td>
<td>Navigator 2.0</td> 
</tr>
<tr>
<td>JavaScript 1.1</td>
<td>Navigator 3.0</td>
</tr>
<tr>
<td>JavaScript 1.2</td>
<td>Navigator 4.0-4.05</td>
</tr>
<tr>
<td>JavaScript 1.3</td>
<td>Navigator 4.06-4.7x</td>
</tr>
<tr>
<td>JavaScript 1.4</td>
<td> </td>
</tr>
<tr>
<td>JavaScript 1.5</td>
<td>Navigator 6.0<br>Mozilla (open source browser)</td>
</tr>
</tbody></table>
<p><small><b>Table 1: JavaScript and Navigator versions</b></small><br>
<br>
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.
</p>
<table class="fullwidth-table">
<tbody><tr>
<th>Abbreviation</th>
<th>Enterprise Server version</th>
</tr>
<tr>
<td>NES 2.0</td>
<td>Netscape Enterprise Server 2.0</td>
</tr>
<tr>
<td>NES 3.0</td>
<td>Netscape Enterprise Server 3.0</td>
</tr>
</tbody></table>
<p><small><b>Table 2: Abbreviations of Netscape Enterprise Server versions</b></small>
</p>
<h3 name="Where_to_find_JavaScript_Information"> Where to find JavaScript Information </h3>
<p>The core JavaScript documentation includes the following books:
</p>
<ul><li> <a href="cn/Core_JavaScript_1.5_Guide">The Core JavaScript Guide</a> (this guide) provides information about the core JavaScript language and its objects.
</li><li> <a href="cn/Core_JavaScript_1.5_Reference">The Core JavaScript Reference</a> provides reference material for the core JavaScript language.
</li></ul>
<p>If you are new to JavaScript, start with the <a href="cn/Core_JavaScript_1.5_Guide">Core JavaScript Guide</a>. Once you have a firm grasp of the fundamentals, you can use the <a href="cn/Core_JavaScript_1.5_Reference">Core JavaScript Reference</a> to get more details on individual objects and statements.
</p>
<h3 name="Document_Conventions"> Document Conventions </h3>
<p>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.
</p><p>This book uses uniform resource locators (URLs) of the following form:
</p><p><code><span class="plain">http://server.domain/path/file.html</span></code>
</p><p>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.
</p><p>This guide uses the following font conventions:
</p>
<ul><li> The <code>monospace font</code> 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.)
</li><li> <i>Italic type</i> is used for book titles, emphasis, variables and placeholders, and words used in the literal sense.
</li><li> <b>Boldface</b> type is used for glossary terms.
</li></ul>
<p>{{template.PreviousNext("Core_JavaScript_1.5_Guide", "Core_JavaScript_1.5_Guide:JavaScript_Overview")}}
</p>{{ wiki.languages( { "pl": "pl/Przewodnik_po_j\u0119zyku_JavaScript_1.5/O" } ) }}
恢复到这个版本