关于

  • 版本网址缩略名: Core_JavaScript_1.5_Guide/关于
  • 版本标题: 关于
  • 版本 id: 268348
  • 创建于:
  • 创建者: Yinwm
  • 是否是当前版本?
  • 评论 /* What You Should Already Know */

修订内容

这个Release版本中的新特性

JavaScript 1.5版提供了如下的特性和功能曾强:

运行时错误(Runtime errors)
运行时错误(Runtime errors)将不会被报告为异常(exceptions).

数字格式曾强(Number formatting enhancements)
数字格式通过包含Number.prototype.toExponential,Number.prototype.toFixed和Number.prototype.toPrecision方法进行曾强。请参阅数字对象

正则表达式曾强(Regular expression enhancements)
正则表达式添加了如下特性:

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

方法表达式(Function expressions)
方法(Functions)(对象)可以作为表达式的一部分。请参阅定义方法(对象)

多重catch子句(Multiple catch clauses)
在try...catch表达式中,可以定义多重catch子句。请参阅The catch Block

Getter和Setter(Getters and Setters)
JavsScript对对象(Object)提供了getter和setter方法。这个特性只存在于C语言实现的 JavaScript当中。请参阅定义Getter和Setter方法

常量(Constants)
Read only named constants are supported. This feature is available only in the C implementation of JavaScript. 请参阅常量

你应该知道什么

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=".E8.BF.99.E4.B8.AARelease.E7.89.88.E6.9C.AC.E4.B8.AD.E7.9A.84.E6.96.B0.E7.89.B9.E6.80.A7"> 这个Release版本中的新特性 </h3>
<p>JavaScript 1.5版提供了如下的特性和功能曾强:
</p><p><b>运行时错误(Runtime errors)</b><br>
运行时错误(Runtime errors)将不会被报告为异常(exceptions).
</p><p><b>数字格式曾强(Number formatting enhancements)</b><br>
数字格式通过包含Number.prototype.toExponential,Number.prototype.toFixed和Number.prototype.toPrecision方法进行曾强。请参阅<a href="cn/Core_JavaScript_1.5_Guide/%e9%a2%84%e5%ae%9a%e4%b9%89%e6%a0%b8%e5%bf%83%e5%af%b9%e8%b1%a1/%e6%95%b0%e5%ad%97%e5%af%b9%e8%b1%a1">数字对象</a>
</p><p><b>正则表达式曾强(Regular expression enhancements)</b><br>
正则表达式添加了如下特性:        
</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)(对象)可以作为表达式的一部分。请参阅<a href="cn/Core_JavaScript_1.5_Guide/%e5%ae%9a%e4%b9%89%e6%96%b9%e6%b3%95%ef%bc%88%e5%af%b9%e8%b1%a1%ef%bc%89">定义方法(对象)</a>
</p><p><b>多重catch子句(Multiple catch clauses)</b><br>
在try...catch表达式中,可以定义多重catch子句。请参阅<a href="cn/Core_JavaScript_1.5_Guide/%e5%bc%82%e5%b8%b8%e5%a4%84%e7%90%86%e8%a1%a8%e8%be%be%e5%bc%8f/try...catch%e8%a1%a8%e8%be%be%e5%bc%8f#The_catch_Block">The catch Block</a>
</p><p><b>Getter和Setter(Getters and Setters)</b><br>
JavsScript对对象(Object)提供了getter和setter方法。这个特性只存在于C语言实现的 JavaScript当中。请参阅<a href="cn/Core_JavaScript_1.5_Guide/%e5%88%9b%e5%bb%ba%e6%96%b0%e5%af%b9%e8%b1%a1/%e5%ae%9a%e4%b9%89Getter%e5%92%8cSetter%e6%96%b9%e6%b3%95">定义Getter和Setter方法</a>
</p><p><b>常量(Constants)</b> <br>
Read only named constants are supported. This feature is available only in the C implementation of JavaScript. 请参阅<a href="cn/Core_JavaScript_1.5_Guide/%e5%b8%b8%e9%87%8f">常量</a>
</p>
<h3 name=".E4.BD.A0.E5.BA.94.E8.AF.A5.E7.9F.A5.E9.81.93.E4.BB.80.E4.B9.88"> 你应该知道什么 </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" } ) }}
恢复到这个版本