跳到内容(1) Cob.com.cn

教程·Javascript 中文手册

您的位置:首页>>教程>>Javascript手册

此参考中包含的内容

This reference is organized around the 函数ality of the JavaScript language. Sometimes you already know the name of an object or method, but don't know precisely where to look for it. This chapter contains tables of links to aid in this situation.

is a list of all JavaScript operators, grouped by type of operator.

is an alphabetical list of all JavaScript statements.

is an alphabetical list of all of JavaScript's predefined classes and objects. The predefined methods and properties for each object are listed.

is an alphabetical list of all predefined methods, regardless of the object to which they belong. The second column indicates the object with which the method is associated. There are separate entries for methods of the same name used in different objects. Each method name links to the method in the indicated object.

Similarly, is an alphabetical list of all predefined properties, regardless of the object to which they belong. The second column indicates the object with which the property is associated.

is an alphabetical list of JavaScript's global 函数s. These are 函数s which aren't associated with any object.

is an alphabetical list of all JavaScript event handlers.

Key to the versions

If there is an entry in both the Client Version and the Server Version columns for a single construct, that construct is part of the core language. Otherwise, it is defined only for the client or for the server, as indicated.

The version number indicates the versions of Netscape Navigator (Nav), LiveWire (LW), or the Netscape servers (Svr), such as Enterprise Server and FastTrack Server), for which the construct is defined.

表 1 Operators  

Operator Category Operator Client version Serverversion
LW 1
++ Nav 2 LW 1
- Nav 2 LW 1
-- Nav 2 LW 1
* Nav 2 LW 1
/ Nav 2 LW 1
% Nav 2 LW 1
LW 1
+= Nav 2 LW 1
LW 1
|| Nav 2 LW 1
! Nav 2 LW 1
LW 1
^ Nav 2 LW 1
| Nav 2 LW 1
~ Nav 2 LW 1
<< Nav 2 LW 1
>> Nav 2 LW 1
>>> Nav 2 LW 1
LW 1
+= Nav 2 LW 1
-= Nav 2 LW 1
*= Nav 2 LW 1
/= Nav 2 LW 1
%= Nav 2 LW 1
&= Nav 2 LW 1
^= Nav 2 LW 1
|= Nav 2 LW 1
<<= Nav 2 LW 1
>>= Nav 2 LW 1
>>>= Nav 2 LW 1
LW 1
!= Nav 2 LW 1
> Nav 2 LW 1
>= Nav 2 LW 1
< Nav 2 LW 1
<= Nav 2 LW 1
LW 1
, Nav 2 LW 1
LW 1 LW 1 LW 1
LW 1 LW 1 --

  表 2 Statements  

Statement Client version Serverversion
LW 1+ LW 1+ LW 1+
Svr 3 Svr 3 Svr 3
LW 1+ LW 1+ LW 1+
LW 1+ Svr 3 Svr 3
LW 1+ Svr 3 LW 1+
LW 1+ LW 1+ --

Object Clientversion Serverversion Methods Properties Eventhandlers
onMouseUp onFocus onMouseUp onFocus onSubmit onLoad
onMouseOver onMouseOver onFocus onFocus onFocus onFocus
onFocus onSelect onSelect onUnload -- --

  表 3 Objects with their methods and properties  

  表 4 Methods  

Method Of 对象 Clientversion ServerVersion
LW 1+ LW 1+ LW 1+ LW 1+
LW 1+ LW 1+ Svr 3 LW 1+
LW 1+ LW 1+ LW 1+ LW 1+
LW 1+ LW 1+ LW 1+ LW 1+
Svr 3 LW 1+ LW 1+ LW 1+
Svr 3 Svr 3 LW 1+ Svr 3
LW 1+ Svr 3 Svr 3 LW 1+
Svr 3 Svr 3 Svr 3 LW 1+
Svr 3 connected Connection
connected database -- LW 1+
connected DbPool -- Svr 3
connection DbPool -- Svr 3
cos Math Nav 2+ LW 1+
cursor Connection -- Svr 3
cursor database -- LW 1+
DbPool DbPool -- Svr 3
deleteRow Cursor -- LW 1+
destroy client -- LW 1+
disableExternalCapture Window Nav 4 --
disconnect database -- LW 1+
disconnect DbPool -- Svr 3
enableExternalCapture Window Nav 4 --
eof File -- LW 1+
error File -- LW 1+
errorCode SendMail -- Svr 3
errorMessage SendMail -- Svr 3
eval Object Nav 3 LW 1+
exec RegExp Nav 4 Svr 3
execute Connection -- Svr 3
execute database -- LW 1+
exists File -- LW 1+
exp Math Nav 2+ LW 1+
expiration client -- LW 1+
find Window Nav 4 --
fixed String Nav 2+ LW 1+
floor Math Nav 2+ LW 1+
flush File -- LW 1+
focus Button Nav 2+ --
focus Checkbox Nav 2+ --
focus FileUpload Nav 2+ --
focus Password Nav 2+ --
focus Radio Nav 2+ --
focus Reset Nav 2+ --
focus Select Nav 2+ --
focus Submit Nav 2+ --
focus Text Nav 2+ --
focus Textarea Nav 2+ --
focus Window Nav 3+ --
fontcolor String Nav 2+ LW 1+
fontsize String Nav 2+ LW 1+
forward History Nav 2+ --
forward Window Nav 4 --
fromCharCode String Nav 4 Svr 3
getDate Date Nav 2+ LW 1+
getDay Date Nav 2+ LW 1+
getHours Date Nav 2+ LW 1+
getLength File -- LW 1+
getMinutes Date Nav 2+ LW 1+
getMonth Date Nav 2+ LW 1+
getPosition File -- LW 1+
getSeconds Date Nav 2+ LW 1+
getSelection document Nav 4 --
getTime Date Nav 2+ LW 1+
getTimezoneOffset Date Nav 2+ LW 1+
getYear Date Nav 2+ LW 1+
go History Nav 2+ --
handleEvent Button Nav 4 --
handleEvent Checkbox Nav 4 --
handleEvent document Nav 4 --
handleEvent FileUpload Nav 4 --
handleEvent Form Nav 4 --
handleEvent Image Nav 4 --
handleEvent Layer Nav 4 --
handleEvent Link Nav 4 --
handleEvent Password Nav 4 --
handleEvent Radio Nav 4 --
handleEvent Reset Nav 4 --
handleEvent Select Nav 4 --
handleEvent Submit Nav 4 --
handleEvent Text Nav 4 --
handleEvent Textarea Nav 4 --
handleEvent Window Nav 4 --
home Window Nav 4 --
indexOf String Nav 2+ LW 1+
insertRow Cursor -- LW 1+
isValid Lock -- Svr 3
italics String Nav 2+ LW 1+
javaEnabled navigator Nav 3+ --
join Array Nav 3+ LW 1+
lastIndexOf String Nav 2+ LW 1+
link String Nav 2+ LW 1+
load Layer Nav 4 --
lock Lock -- Svr 3
lock project -- LW 1+
lock server -- LW 1+
log Math Nav 2+ LW 1+
majorErrorCode Connection -- Svr 3
majorErrorCode database -- LW 1+
majorErrorCode DbPool -- Svr 3
majorErrorMessage Connection -- Svr 3
majorErrorMessage database -- LW 1+
majorErrorMessage DbPool -- Svr 3
match String Nav 4 Svr 3
max Math Nav 2+ LW 1+
min Math Nav 2+ LW 1+
minorErrorCode Connection -- Svr 3
minorErrorCode database -- LW 1+
minorErrorCode DbPool -- Svr 3
minorErrorMessage Connection -- Svr 3
minorErrorMessage database -- LW 1+
minorErrorMessage DbPool -- Svr 3
moveAbove Layer Nav 4 --
moveBelow Layer Nav 4 --
moveBy Layer Nav 4 --
moveBy Window Nav 4 --
moveTo Layer Nav 4 --
moveTo Window Nav 4 --
moveToAbsolute Layer Nav 4 --
next Cursor -- LW 1+
next Resultset -- Svr 3
open document Nav 2+ --
open File -- LW 1+
open Window Nav 2+ --
outParamCount Stproc -- Svr 3
outParameters Stproc -- Svr 3
parse Date Nav 2+ LW 1+
plugins.refresh navigator Nav 3+ --
pop Array Nav 4 Svr 3
pow Math Nav 2+ LW 1+
preference navigator Nav 4 --
print Window Nav 4 --
prompt Window Nav 2+ --
push Array Nav 4 Svr 3
random Math Nav 2+ LW 1+
read File -- LW 1+
readByte File -- LW 1+
readln File -- LW 1+
refresh navigator.plugins Nav 3+ --
release Connection -- Svr 3
releaseEvents document Nav 4 --
releaseEvents Layer Nav 4 --
releaseEvents Window Nav 4 --
reload Location Nav 3+ --
replace Location Nav 3+ --
replace String Nav 4 Svr 3
reset Form Nav 3+ --
resizeBy Layer Nav 4 --
resizeBy Window Nav 4 --
resizeTo Layer Nav 4 --
resizeTo Window Nav 4 --
resultSet Stproc -- Svr 3
returnValue Stproc -- Svr 3
reverse Array Nav 3+ LW 1+
rollbackTransaction Connection -- Svr 3
rollbackTransaction database -- LW 1+
round Math Nav 2+ LW 1+
routeEvent document Nav 4 --
routeEvent Layer Nav 4 --
routeEvent Window Nav 4 --
scroll Window Nav 2-3 --
scrollBy Window Nav 4 --
scrollTo Window Nav 4 --
search String Nav 4 Svr 3
select FileUpload Nav 2+ --
select Password Nav 2+ --
select Text Nav 2+ --
select Textarea Nav 2+ --
send SendMail -- Svr 3
setDate Date Nav 2+ LW 1+
setHours Date Nav 2+ LW 1+
setInterval Window Nav 4 --
setMinutes Date Nav 2+ LW 1+
setMonth Date Nav 2+ LW 1+
setPosition File -- LW 1+
setSeconds Date Nav 2+ LW 1+
setTime Date Nav 2+ LW 1+
setTimeout Window Nav 2+ --
setYear Date Nav 2+ LW 1+
shift Array Nav 4 Svr 3
sin Math Nav 2+ LW 1+
slice Array Nav 4 Svr 3
slice String Nav 4 Svr 3
small String Nav 2+ LW 1+
sort Array Nav 3+ LW 1+
splice Array Nav 4 Svr 3
split String Nav 3+ LW 1+
SQL表 Connection -- Svr 3
SQL表 database -- LW 1+
sqrt Math Nav 2+ LW 1+
stop Window Nav 4 --
storedProc Connection -- Svr 3
storedProc database -- Svr 3
storedProcArgs database -- Svr 3
storedProcArgs DbPool -- Svr 3
strike String Nav 2+ LW 1+
stringToByte File -- LW 1+
sub String Nav 2+ LW 1+
submit Form Nav 2+ --
substr String Nav 4 Svr 3
substring String Nav 2+ LW 1+
sup String Nav 2+ LW 1+
taintEnabled navigator Nav 3 LW 1
tan Math Nav 2+ LW 1+
test RegExp Nav 4 Svr 3
toGMTString Date Nav 2+ LW 1+
toLocaleString Date Nav 2+ LW 1+
toLowerCase String Nav 2+ LW 1+
toString Array Nav 3+ LW 1+
toString Boolean Nav 3+ LW 1+
toString Connection -- Svr 3
toString database -- LW 1+
toString DbPool -- Svr 3
toString Number Nav 3+ LW 1+
toString Object Nav 2+ LW 1+
toUpperCase String Nav 2+ LW 1+
unlock Lock -- Svr 3
unlock project -- LW 1+
unlock server -- LW 1+
unshift Array Nav 4 Svr 3
unwatch Object Nav 4 Svr 3
updateRow Cursor -- LW 1+
UTC Date Nav 2+ LW 1+
valueOf Object Nav 3+ LW 1+
watch Object Nav 4 Svr 3
write document Nav 2+ --
write File -- LW 1+
writeByte File -- LW 1+
writeln document Nav 2+ --
writeln File -- LW 1+

  表 5 Properties  

Property Of 对象 Clientversion Serverversion
$1, ..., $9

RegExp Nav 4 Svr 3
$_ RegExp Nav 4 Svr 3
$* RegExp Nav 4 Svr 3
$& RegExp Nav 4 Svr 3
$+ RegExp Nav 4 Svr 3
$` RegExp Nav 4 Svr 3
$' RegExp Nav 4 Svr 3
above Layer Nav 4 --
action Form Nav 2+ --
agent request -- LW 1+
alinkColor document Nav 2+ --
anchors document Nav 2+ --
appCodeName navigator Nav 2+ --
applets document Nav 3+ --
appName navigator Nav 2+ --
appVersion navigator Nav 2+ --
arguments 函数 Nav 3+ LW 1+
arity 函数 Nav 4 LW 1+
background Layer Nav 4 --
below Layer Nav 4 --
bgColor document Nav 2+ --
bgColor Layer Nav 4 --
border Image Nav 3+ --
caller 函数 Nav 3+ LW 1+
checked Checkbox Nav 2+ --
checked Radio Nav 2+ --
clip.bottom Layer Nav 4 --
clip.height Layer Nav 4 --
clip.left Layer Nav 4 --
clip.right Layer Nav 4 --
clip.top Layer Nav 4 --
clip.width Layer Nav 4 --
closed Window Nav 3+ --
colorDepth screen Nav 4 --
complete Image Nav 3+ --
constructor Object Nav 3+ LW 1+
cookie document Nav 2+ --
current History Nav 3+ --
cursorColumn Cursor -- LW 1+
data event Nav 4 --
defaultChecked Checkbox Nav 2+ --
defaultChecked Radio Nav 2+ --
defaultStatus Window Nav 2+ --
defaultSelected Option Nav 3+ --
defaultValue Password Nav 2+ --
defaultValue Text Nav 2+ --
defaultValue Textarea Nav 2+ --
description MimeType Nav 3+ --
description Plugin Nav 3+ --
document Layer Nav 4 --
document Window Nav 2+ --
domain document Nav 3+ --
E Math Nav 2+ LW 1+
elements Form Nav 2+ --
embeds document Nav 3+ --
enabledPlugin MimeType Nav 3+ --
encoding Form Nav 2+ --
fgColor document Nav 2+ --
filename Plugin Nav 3+ --
form Button Nav 2+ --
form Checkbox Nav 2+ --
form FileUpload Nav 2+ --
form Hidden Nav 2+ --
form Password Nav 2+ --
form Radio Nav 2+ --
form Reset Nav 2+ --
form Select Nav 2+ --
form Submit Nav 2+ --
form Text Nav 2+ --
form Textarea Nav 2+ --
formName document Nav 3+ --
forms document Nav 3+ --
frames Window Nav 2+ --
global RegExp Nav 4 Svr 3
hash Link Nav 2+ --
hash Location Nav 2+ --
height event Nav 4 --
height Image Nav 3+ --
height screen Nav 4 --
history Window Nav 2+ --
host Link Nav 2+ --
host Location Nav 2+ --
host server -- LW 1+
hostname Link Nav 2+ --
hostname Location Nav 2+ --
hostname server -- LW 1+
href Link Nav 2+ --
href Location Nav 2+ --
hspace Image Nav 3+ --
ignoreCase RegExp Nav 4 Svr 3
images document Nav 3+ --
imageX request -- LW 1+
imageY request -- LW 1+
index Array Nav 4 Svr 3
input Array Nav 4 Svr 3
innerHeight Window Nav 4 --
innerWidth Window Nav 4 --
input RegExp Nav 4 Svr 3
inputName request -- LW 1+
ip request -- LW 1+
language navigator Nav 4 --
lastIndex RegExp Nav 4 Svr 3
lastMatch RegExp Nav 4 Svr 3
lastModified document Nav 2+ --
lastParen RegExp Nav 4 Svr 3
layerX event Nav 4 --
layerY event Nav 4 --
layers document Nav 4 --
left Layer Nav 4 --
leftContext RegExp Nav 4 Svr 3
length Array Nav 3+ LW 1+
length Form Nav 2+ --
length History Nav 2+ --
length Plugin Nav 3+ --
length Select Nav 2+ --
length String Nav 2+ LW 1+
length Window Nav 2+ --
linkColor document Nav 2+ --
links document Nav 2+ --
location Window Nav 2+ --
locationbar Window Nav 4 --
LN10 Math Nav 2+ LW 1+
LN2 Math Nav 2+ LW 1+
LOG10E Math Nav 2+ LW 1+
LOG2E Math Nav 2+ LW 1+
lowsrc Image Nav 3+ --
MAX_VALUE Number Nav 3+ LW 1+
menubar Window Nav 4 --
方法 Form Nav 2+ --
方法 request -- LW 1+
mimeTypes navigator Nav 3+ --
modifiers event Nav 4 --
MIN_VALUE Number Nav 3+ LW 1+
multiline RegExp Nav 4 Svr 3
name Button Nav 2+ --
name Checkbox Nav 2+ --
name FileUpload Nav 2+ --
name Form Nav 2+ --
name Hidden Nav 2+ --
name Image Nav 3+ --
name Layer Nav 4 --
name Password Nav 2+ --
name Plugin Nav 3+ --
name Radio Nav 2+ --
name Reset Nav 2+ --
name Select Nav 2+ --
name Submit Nav 2+ --
name Text Nav 2+ --
name Textarea Nav 2+ --
name Window Nav 2+ --
NaN Number Nav 3+ LW 1+
NEGATIVE_INFINITY Number Nav 3+ LW 1+
next History Nav 3+ --
opener Window Nav 3+ --
options Select Nav 2+ --
outerHeight Window Nav 4 --
outerWidth Window Nav 4 --
pageX event Nav 4 --
pageX Layer Nav 4 --
pageXOffset Window Nav 4 --
pageY event Nav 4 --
pageY Layer Nav 4 --
pageYOffset Window Nav 4 --
parent Window Nav 2+ --
parentLayer Layer Nav 4 --
pathname Link Nav 2+ --
pathname Location Nav 2+ --
personalbar Window Nav 4 --
PI Math Nav 2+ LW 1+
pixelDepth screen Nav 4 --
platform navigator Nav 4 --
plugins document Nav 3+ --
plugins navigator Nav 3+ --
port Link Nav 2+ --
port Location Nav 2+ --
port server -- LW 1+
POSITIVE_INFINITY Number Nav 3+ LW 1+
previous History Nav 3+ --
protocol Link Nav 2+ --
protocol Location Nav 2+ --
protocol request -- LW 1+
protocol server -- LW 1+
prototype Array Nav 3+ LW 1+
prototype Boolean Nav 3+ LW 1+
prototype Connection -- Svr 3
prototype Cursor Nav 3+ LW 1+
prototype database -- LW 1+
prototype Date Nav 3+ LW 1+
prototype DbPool -- Svr 3
prototype File -- LW 1+
prototype 函数 Nav 3+ LW 1+
prototype Image Nav 3+ LW 1+
prototype Number Nav 3+ LW 1+
prototype Object Nav 3+ LW 1+
prototype Resultset -- Svr 3
prototype SendMail -- Svr 3
prototype Stproc -- Svr 3
prototype String Nav 3+ LW 1+
referrer document Nav 2+ --
rightContext RegExp Nav 4 Svr 3
screenX event Nav 4 --
screenY event Nav 4 --
scrollbars Window Nav 4 --
search Link Nav 2+ --
search Location Nav 2+ --
selected Option Nav 2+ --
selectedIndex Select Nav 2+ --
self Window Nav 2+ --
siblingAbove Layer Nav 4 --
siblingBelow Layer Nav 4 --
source RegExp Nav 4 Svr 3
SQRT1_2 Math Nav 2+ LW 1+
SQRT2 Math Nav 2+ LW 1+
src Image Nav 3+ --
src Layer Nav 4 --
status Window Nav 2+ --
statusbar Window Nav 4 --
suffixes MimeType Nav 3+ --
target event Nav 4 --
target Form Nav 2+ --
target Link Nav 2+ --
text Option Nav 2+ --
text Link Nav 4 --
title document Nav 2+ --
toolbar Window Nav 4 --
top Layer Nav 4 --
top Window Nav 2+ --
type Button Nav 3+ --
type Checkbox Nav 3+ --
type event Nav 4 --
type FileUpload Nav 3+ --
type Hidden Nav 3+ --
type Password Nav 3+ --
type MimeType Nav 3+ --
type Radio Nav 3+ --
type Reset Nav 3+ --
type Select Nav 3+ --
type Submit Nav 3+ --
type Text Nav 3+ --
type Textarea Nav 3+ --
URL document Nav 2+ --
userAgent navigator Nav 2+ --
value Button Nav 2+ --
value Checkbox Nav 2+ --
value FileUpload Nav 2+ --
value Hidden Nav 2+ --
value Option Nav 2+ --
value Password Nav 2+ --
value Radio Nav 2+ --
value Reset Nav 2+ --
value Submit Nav 2+ --
value Text Nav 2+ --
value Textarea Nav 2+ --
visibility Layer Nav 4 --
vlinkColor document Nav 2+ --
vspace Image Nav 3+ --
which event Nav 4 --
width event Nav 4 --
width Image Nav 3+ --
width screen Nav 4 --
window Window Nav 2+ --
zIndex Layer Nav 4 --

  表 6 Global 函数s  

函数 Clientversion Serverversion
addClient -- LW 1+
addResponseHeader -- Svr 3
blob -- LW 1+
callC -- LW 1+
debug -- LW 1+
deleteResponseHeader -- Svr 3
escape Nav 2+ LW 1+
eval Nav 2+ LW 1+
flush -- LW 1+
getOptionValue -- LW 1+
getOptionValueCount -- LW 1+
isNaN Nav 3+ LW 1+
Number Nav 4 Svr 3
parseFloat Nav 3+ LW 1+
parseInt Nav 3+ LW 1+
redirect -- LW 1+
registerC函数 -- LW 1+
ssjs_generateClientID -- Svr 3
ssjs_getCGIVariable -- Svr 3
ssjs_getClientID -- Svr 3
String Nav 4 Svr 3
taint Nav 3 LW 1+
unescape Nav 2+ LW 1+
untaint Nav 3 LW 1+
write -- LW 1+

  表 7 Event handlers 

, Password, Reset, Submit, Textarea, Window, Textarea, Radio, Submit, Password, Reset, Submit, Textarea, Window, Textarea, Textarea, Textarea
Event handler Clientversion Handler for
onAbort Nav 3+ Image
onBlur Nav 3+ Button,FileUpload
onChange Nav 3+ FileUpload,Text
onClick Nav 3+ Button,document
onDblClick Nav 4 document,Link
onDragDrop Nav 4 Window
onError Nav 3+ Image,Window
onFocus Nav 3+ Button,FileUpload
onKeyDown Nav 4 document,Link
onKeyPress Nav 4 document,Link
onKeyUp Nav 4 document,Link
onLoad Nav 3+ Image,Window
onMouseDown Nav 4 Button,Link
onMouseMove Nav 4 --
onMouseOut Nav 3+ Layer,Link
onMouseOver Nav 3+ Layer,Link
onMouseUp Nav 4 Button,Link
onMove Nav 4 Window
onReset Nav 3+ Form
onResize Nav 4 Window
onSelect Nav 3+ Text,Textarea
onSubmit Nav 3+ Form
onUnload Nav 3+ Window
End Nav