Server-Side JavaScript 1.2 Reference

Cha UmRWLoerldrWcidehWebasnetcsuyrsittyem community system

server navigator TCP/IP HTML

ublishing

PersonalServer-Side JavaScript

ww PrIontxeyr Reference

SSL

Version 1.2

Mozilla

IStore

Internet Publishing secure sockets layer encryption

HTML

mail

comp.sys electronic commerce

JavaScript

directory server

certificate

Netscape Communications Corporation ("Netscape") and its licensors retain all ownership rights to the software programs offered by Netscape (referred to herein as "Software") and related documentation. Use of the Software and related documentation is governed by the license agreement accompanying the Software and applicable copyright law. Your right to copy this documentation is limited by copyright law. Making unauthorized copies, adaptations, or compilation works is prohibited and constitutes a punishable violation of the law. Netscape may revise this documentation from time to time without notice. THIS DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN NO EVENT SHALL NETSCAPE BE LIABLE FOR INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY KIND ARISING FROM ANY ERROR IN THIS DOCUMENTATION, INCLUDING WITHOUT LIMITATION ANY LOSS OR INTERRUPTION OF BUSINESS, PROFITS, USE, OR DATA. The Software and documentation are copyright ?1994-1998 Netscape Communications Corporation. All rights reserved. Netscape, Netscape Navigator, Netscape Certificate Server, Netscape DevEdge, Netscape FastTrack Server, Netscape ONE, SuiteSpot and the Netscape N and Ship's Wheel logos are registered trademarks of Netscape Communications Corporation in the United States and other countries. Other Netscape logos, product names, and service names are also trademarks of Netscape Communications Corporation, which may be registered in other countries. JavaScript is a trademark of Sun Microsystems, Inc. used under license for technology invented and implemented by Netscape Communications Corporation. Other product and brand names are trademarks of their respective owners. The downloading, exporting, or reexporting of Netscape software or any underlying information or technology must be in full compliance with all United States and other applicable laws and regulations. Any provision of Netscape software or documentation to the U.S. Government is with restricted rights as described in the license agreement accompanying Netscape software.

.

Recycled and Recyclable Paper

Version 1.2 ?1998 Netscape Communications Corporation. All Rights Reserved Printed in the United States of America. 00 99 98 5 4 3 2 1

Netscape Communications Corporation, 501 East Middlefield Road, Mountain View, CA 94043

New Features in this Release

JavaScript version 1.2 provides the following new features and enhancements: ? Changes to the Array object.

? Array objects can be created using literal notation. ? When the tag includes LANGUAGE="JavaScript1.2",

array(1) creates a new array with a[0]=1. ? When created as the result of a match between a regular expression

and a string, arrays have new properties that provide information about the match. ? concat joins two arrays and returns a new array. ? pop removes the last element from an array and returns that element. ? push adds one or more elements to the end of an array and returns that last element added. ? shift removes the first element from an array and returns that element ? unshift adds one or more elements to the front of an array and returns the new length of the array. ? slice extracts a section from an array and returns a new array ? splice adds and/or removes elements from an array and returns the removed elements. ? sort now works on all platforms. It no longer converts undefined elements to null; instead, it sorts them to the high end of the array.

3

? Changes to the Function object.

? Nested functions. You can nest functions within functions. (That is, JavaScript now supports lambda expressions and lexical closures.) See Function.

? New function property arity. The arity property indicates the number of arguments expected by a function.

? New arguments property. The arguments.callee property provides information about the invoked function.

? New Lock class. The Lock class allows safe sharing of information with multiple incoming requests.

? Changes to the Number object. Number now produces NaN rather than an error if x is a string that does not contain a well-formed numeric literal.

? New RegExp object for regular expressions. Regular expressions are patterns used to match character combinations in strings. You create a regular expression as an object that has methods used to execute a match against a string. You can also pass the regular expression as an argument to the String methods match, replace, search, and split. The RegExp object has properties most of which are set when a match is successful, such as lastMatch which specifies the last successful match. The Array object has new properties that provide information about a successful match such as input which specifies the original input string against which the match was executed. See RegExp for information.

? New SendMail class. The SendMail class lets you generate email from JavaScript.

? New or changed String methods.

? charCodeAt returns a number specifying the ISO-Latin-1 codeset value of the character at the specified index in a string object.

? concat combines the text of two strings and returns a new string.

? fromCharCode constructs a string from a specified sequence of numbers that are ISO-Latin-1 codeset values.

? match executes a search for a match between a string and a regular expression.

4 Server-Side JavaScript Reference

? replace executes a search for a match between a string and a regular expression, and replaces the matched substring with a new substring.

? search tests for a match between a string and a regular expression. ? slice extracts a section of an string and returns a new string. ? split includes several new features and changes. It can take a regular

expression argument, as well as a fixed string, by which to split the object string. It can take a limit count so that it won't include trailing empty elements in the resulting array. If you specify LANGUAGE="JavaScript1.2" in the tag, string.split(" ") splits on any run of one or more white space characters including spaces, tabs, line feeds, and carriage returns. ? substr returns the characters in a string collecting the specified number of characters beginning with a specified location in the string. ? substring if you specify LANGUAGE="JavaScript1.2" in the tag, this method no longer swaps index numbers when the first index is greater than the second. ? New top-level functions Number and String. The Number function converts an object to a number. The String function converts an object to a string. ? Changes to methods of all objects. ? eval is no longer a method of individual objects; it is available only as a top-level function. ? toString converts an object or array to a literal. For this behavior, LANGUAGE="JavaScript1.2" must be specified in the tag. ? watch is a new method of all objects. It watches for a property to be assigned a value and runs a function when that occurs. ? unwatch is a new method of all objects. It removes a watchpoint set with the watch method.

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download