World Wide Web security URLmerchant systemChat community system server navigator TCP/IP HTML Publishing Personal Client-Side JavaScript Reference Inter ww Version 1.3 Proxy SSL Mozilla IStore Publishing Internet secure sockets layer mail encryption HTMLhttp://www comp.syselectronic commerce JavaScript directory server news certificate Proxy 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-1999 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.3 ©1999 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.3 provides the following new features and enhancements: • ECMA compliance. JavaScript 1.3 is fully compatible with ECMA-262. See the Client-Side JavaScript Guide for details. • Unicode support. The Unicode character set can be used for all known encoding, and you can use the Unicode escape sequence in string literals. See escape and unescape. See the Client-Side JavaScript Guide for details. • Changes to the Array object. • When you specify a single numeric parameter with the Array constructor, you specify the initial length of the array. •The push method returns the new length of the array rather than the last element added to the array. •The splice method always returns an array containing the removed elements, even if only one element is removed. •The toString method joins an array and returns a string containing each array element separated by commas, rather than returning a string representing the source code of the array. •The length property contains an unsigned, 32-bit integer with a value less than 232. 3 • Changes to the Date object. • Removed platform dependencies to provide a uniform behavior across platforms. • Changed the range for dates to -100,000,000 days to 100,000,000 days relative to 01 January, 1970 UTC. • Added a milliseconds parameter to the Date constructor. • Added the getFullYear, setFullYear, getMilliseconds, and setMilliseconds methods. • Added the getUTCDate, getUTCDay, getUTCFullYear, getUTCHours, getUTCMilliseconds, getUTCMinutes, getUTCMonth, getUTCSeconds, setUTCDate, setUTCFullYear, setUTCHours, setUTCMilliseconds, setUTCMinutes, setUTCMonth, setUTCSeconds, and toUTCString methods. • Added a day parameter to the setMonth method. • Added minutes, seconds, and milliseconds parameters to the setHours method. • Added seconds and milliseconds parameters to the setMinutes method. • Added a milliseconds parameter to the setSeconds method. • Added a milliseconds parameter to the UTC method. • Deprecated the getYear, setYear, and toGMTString methods. • Changes to the Function object. • Added the apply method, which allows you to apply a method of another object in the context of a different object (the calling object). • Added the call method, which allows you to call (execute) a method of another object in the context of a different object (the calling object). • Deprecated the arguments.caller property. 4 Client-Side JavaScript Reference • Changes to the String object. • The charCodeAt and fromCharCode methods use Unicode values rather than ISO-Latin-1 values. • The replace method supports the nesting of a function in place of the second argument. • New method toSource. The toSource method returns a string representing the source code of the object. See Array.toSource, Boolean.toSource, Date.toSource, Function.toSource, Number.toSource, Object.toSource, RegExp.toSource, and String.toSource. • New top-level properties Infinity, NaN, and undefined. Infinity is a numeric value representing infinity. NaN is a value representing Not-A- Number. undefined is the value undefined. • New top-level function isFinite. isFinite evaluates an argument to determine whether it is a finite number. • Changes to the top-level eval function. You should not indirectly use the eval function by invoking it via a name other than eval. • New strict equality operators === and !==. The === (strict equal) operator returns true if the operands are equal and of the same type. The !== (strict not equal) operator returns true if the operands are not equal and/or not of the same type. See “Comparison Operators” on page 635 and “Using the Equality Operators” on page 637. • Changes to the equality operators == and !=. The use of the == (equal) and != (not equal) operators reverts to the JavaScript 1.1 implementation. If the two operands are not of the same type, JavaScript attempts to convert the operands to an appropriate type for the comparison. See “Using the Equality Operators” on page 637. 5 • Changes to the behavior of conditional tests. • You should not use simple assignments in a conditional statement; for example, do not specify the condition if(x = y). Previous JavaScript versions converted if(x = y) to if(x == y), but 1.3 generates a runtime error. See “if...else” on page 623. • Any object whose value is not undefined or null, including a Boolean object whose value is false, evaluates to true when passed to a conditional statement. See “Boolean” on page 51. • The JavaScript console. The JavaScript console is a window that can display all JavaScript error messages. Then, when a JavaScript error occurs, the error message is directed to the JavaScript console and no dialog box appears. See the Client-Side JavaScript Guide for details. 6 Client-Side JavaScript Reference Contents New Features in this Release .......................................................................3 About this Book ..............................................................................................13 New Features in this Release ..............................................................................13 What You Should Already Know .......................................................................13 JavaScript Versions ..............................................................................................14 Where to Find JavaScript Information ................................................................15 Document Conventions .......................................................................................16 Part 1 Object Reference Chapter 1 Objects, Methods, and Properties ......................................19 Anchor ..................................................................................................................20 Applet ...................................................................................................................25 Area ......................................................................................................................27 Array .....................................................................................................................28 Boolean ................................................................................................................51 Button ...................................................................................................................56 Checkbox .............................................................................................................64 Date ......................................................................................................................72 document ...........................................................................................................108 event ...................................................................................................................143 FileUpload
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages697 Page
-
File Size-