JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the...

14
JavaScript Bible 5th Edition Danny Goodman Appendix A JavaScript and Browser Objects Quick Reference ©2004 Danny Goodman (www.dannyg.com). All Rights Reserved. 18 February 2004

Transcript of JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the...

Page 1: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

JavaScript Bible 5th EditionDanny Goodman

Appendix A

JavaScript and Browser ObjectsQuick Reference

©2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

18 February 2004

Page 2: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

This guide contains quick reference info for the core JavaScriptlanguage, the original document object model (2 pp), the IE4+DHTMLobject model (4 pp), and the W3C DOM object model(4 pp) asimplemented in IE5+, NN6, Mozilla, and Safari browsers. All-uppercase object names refer to HTML elements (IE4+ and W3C DOMs). The three columns in each box list the object’s properties,methods, and event handlers in that order. Read the compatibility guides for each section.

Numbers in the upper right corners of object squares are chapter numbers in which the object is covered in detail.

Basic browser and operating system notation codes are as follows: N — Netscape Navigator (including Mozilla when N6 or higher) IE — MS Internet Explorer W — Windows MSIE M — Macintosh MSIE

See the accompanying file for printing and collating instructionsin booklet or broadside configurations.

JavaScript andBrowser ObjectsQuick Reference

Appendix A

JavaScript Bible, 5th Editionby Danny Goodman

How to Use This Quick Reference

Comparison== Equals=== N4, IE4 Strictly equals!= Does not equal!== N4, IE4 Strictly does not equal> Is greater than>= Is greater than or equal to< Is less than<= Is less than or equal to

Arithmetic+ Plus (and string concat.)- Minus* Multiply/ Divide% Modulo++ Increment-- Decrement-val Negation

Assignment= Equals+= Add by value-= Subtract by value*= Multiply by value/= Divide by value%= Modulo by value<<= Left shift by value>>= Right shift by value>>>= Zero fill by value&= Bitwise AND by value|= Bitwise OR by value^= Bitwise XOR by value

Boolean&& AND|| OR! NOT

Bitwise& Bitwise AND| Bitwise OR^ Bitwise XOR~ Bitwise NOT<< Left shift>> Right shift>>> Zero fill right shift

Miscellaneous, Series delimiterdelete N4, IE4 Property destroyerinN6, W5.5 Item in objectinstanceof N6,W5 Instance ofnew Object creatorthis Object self-referencetypeof N3, IE3 Value typevoid N3, IE3 Return no value

Operators

3

Text & Fontscolor IE4, N6

fontIE4, N6

fontFamily IE4, N6

fontSize IE4, N6

fontSizeAdjust M5, N6

fontStretch M5, N6

fontStyle IE4, N6

fontVariant IE4, N6

fontWeight IE4, N6

letterSpacing IE4, N6

lineBreak IE5

lineHeight IE4, N6

quotes M5, N6

rubyAlign IE5

rubyOverhang IE5

rubyPosition IE5

textAlign IE4, N6

textAlignLast IE5.5

textAutospace W5

textDecoration IE4, N6

textDecorationBlink IE-Only

textDecorationLineThrough IE-Only

textDecorationNone IE-Only

textDecorationOverline IE-Only

textDecorationUnderline IE-Only

textIndent IE4, N6

textJustify IE5

textJustifyTrim IE5

textKashidaSpace IE5.5

textOverflow W6

textShadow M5, N6

textTransform IE4, N6

textUnderlinePosition IE5.5

unicodeBidi IE5, N6

whiteSpace IE4, N6

wordBreakW5

wordSpacing M4, N6, W6

wordWrapW5.5

writingMode W5.5

style IE4,N6

Inline Display & Layoutclear IE4, N6

clip IE4, N6

clipBottom W5

clipLeft W5

clipRight W5

clipTop W5

content M5, N6

counterIncrement M5, N6

counterReset M5, N6

cssFloat M5, N6

cursor IE4, N6

direction IE5, N6

display IE4, N6

filterW4

layoutGrid W5

layoutGridChar W5

layoutGridLine W5

layoutGridMode W5

layoutGridType W5

markerOffsetM5, N6

marks M5, N6

maxHeight M5, N6

maxWidth M5, N6

minHeight M5, N6, W6

minWidth M5, N6

MozOpacity N6

overflow IE4, N6

overflowX W5

overflowY W5

styleFloat IE-Only

verticalAlign IE4, N6

visibility IE4, N6

width IE4, N6

zoomW5.5

ListslistStyle IE4, N6

listStyleImage IE4, N6

listStylePosition IE4, N6

listStyleType IE4, N6

Scrollbars scrollbar3dLightColor W5.5

scrollbarArrowColor W5.5

scrollbarBaseColor W5.5

scrollbarDarkShadowColor W5.5

scrollbarFaceColor W5.5

scrollbarHighlightColor W5.5

scrollbarShadowColor W5.5

scrollbarTrackColor W5.5

Miscellaneousaccelerator W5

behavior W5

cssText IE4, N6

imeMode W5

PrintingorphansM5, N6

widows M5, N6

pageM5, N6

pageBreakAfter IE4, N6

pageBreakBefore IE4, N6

pageBreakInside M5, N6

size N6

TablesborderCollapse M5, N6

borderSpacing M5, N6

captionSide M5, N6

emptyCells M5, N6

tableLayout IE5, N6

Borders & Edges borderIE4, N6

borderBottom IE4, N6

borderLeftIE4, N6

borderRightIE4, N6

borderTopIE4, N6

borderBottomColor IE4, N6

borderLeftColorIE4, N6

borderRightColor IE4, N6

borderTopColorIE4, N6

borderBottomStyle IE4, N6

borderLeftStyle IE4, N6

borderRightStyle IE4, N6

borderTopStyle IE4, N6

borderBottomWidth IE4, N6

borderLeftWidth IE4, N6

borderRightWidth IE4, N6

borderTopWidth IE4, N6

borderColorIE4, N6

borderStyle IE4, N6

borderWidth IE4, N6

margin IE4, N6

marginBottom IE4, N6

marginLeft IE4, N6

marginRight IE4, N6

marginTop IE4, N6

outline M5, N6

outlineColor M5, N6

outlineStyle M5, N6

outlineWidth M5, N6

padding IE4, N6

paddingBottom IE4, N6

paddingLeft IE4, N6

paddingRight IE4, N6

paddingTop IE4, N6

Background background IE4, N6

backgroundAttachment IE4, N6

backgroundColor IE4, N6

backgroundImage IE4, N6

gackgroundPosition IE4, N6

backgroundPositionX IE-Only

backgroundPositionY IE-Only

backgroundRepeat IE4, N6

Positioningbottom IE5, N6

height IE4, N6

left IE4, N6

pixelBottom IE/W-Only

pixelHeight IE-Only

pixelLeft IE-Only

pixelRight IE/W-Only

pixelTop IE-Only

pixelWidth IE-Only

posBottom IE/W-Only

posHeight IE-Only

posLeft IE-Only

posRight IE/W-Only

posTop IE-Only

posWidth IE-Only

position IE4, N6

rightIE5, N6

topIE4, N6

width IE4, N6

zIndex IE4, N6

IE4+, NN6+ style Object Properties © 2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

JSB5

32 26

Page 3: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

5

Page 2 of 2 — Original DOM (NN2+, IE3+) Quick Reference© 2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

JSB5

Original DOMCompatibility Guide

Baseline browsers for this section areNN2, WinIE3/J1, and MacIE3.01. An item with no notation is compatible back to that level, and isfound in all new scriptable browsers since then.Notations indicate the browser and version in which the property, method, or event handler was introduced.

Except for the window and navigator objects (whose listings cover all browsers andversions), new features listed in this section cover only through NN4 (and IE4 when they matched a new NN4 feature). Notations are as follows: N3 — New in NN3 N4 — New in NN4 J2 — New in IE3, JScript.dll ver.2 IE4 — New in IE4, all OSes (S) — Requires signed scripts (NN)Additional window and navigator objectnotations are: W4 — IE4+/Windows only W5 — IE5+/Windows only IE5 — IE5+ all OSes W5.5 — IE5.5+/Windows only W6 — IE6+/Windows only M4 — IE4+/Mac only M5 — IE5+/Mac only N6 — New in NN6 & MozillaExcept for items marked N4-Only (which arenot carried over into NN6), an item listed foran early browser is also available in the IE4+and/or W3C DOM object models.“(None)” means that no methods or eventsexist for the current object through IE3 and NN4.

actionelements[]encodinglengthmethodnametarget

handleEvent( evt)N4

reset()N3, IE4

submit()

onresetN3, IE4

onsubmit

form 21

formnametypeN3, IE4

value

click()handleEvent( evt)N3

button, reset, submitonclickonmousedown N4, IE4

onmouseup N4, IE4

22

checkeddefaultCheckedformnametypeN3, IE4

value

click()handleEvent( evt)N3

checkboxonclickonmousedown N4, IE4

onmouseup N4, IE4

22

checkeddefaultCheckedformlengthnametypeN3, IE4

value

click()handleEvent( evt)N3

radioonclickonmousedown N4, IE4

onmouseup N4, IE4

22

lengthnameoptions[i]options[i].defaultSelectedoptions[i].indexoptions[i].selectedoptions[i].textoptions[i].valueselectedIndextypeN3, IE4

blur()N3, IE4

focus()N3, IE4

handleEvent( evt)N4

selectonbluronchangeonfocus

24

appCodeNameappMinorVersion IE4

appName appVersionbrowserLanguage IE4

cookieEnabled N6, IE4

cpuClass IE4

language N4

mimeTypes[] N3, M4

onLine IE4

oscpu N6

platformN4, IE4

plugins[] N3, M4

productN6

productSub N6

securityPolicy N4

systemLanguage IE4

userAgentuserLanguage IE4

userProfile IE4

vendorN6

vendorSub N6

javaEnabled() N3, M4

preference(name[, val ])N4,(S)

taintEnabled() N3, IE4

navigator 38

descriptionenabledPlugintypesuffixes

(None)

N3,M4mimeType 38

namefilenamedescriptionlength

refresh()

pluginN3,M4 38

(1)N4+ only.(2)WinIE4+ only.

availHeightavailLeft (1)

availTop (1)

availWidthbufferDepth(2)

colorDepthfontSmoothingEnabled (2)

heightpixelDepthupdateInterval (2)

width

(None)

screenN4,IE4 38

(1) Not available for textarea object.(2) Password value property returns empty string in NN2.

defaultValue (1)

formnametypeN3, IE4

value (2)

blur()focus()handleEvent( evt)N4

select()

text, textarea, password, hiddenonbluronchangeonfocusonkeydown N4, IE4

onkeypress N4, IE4

onkeyup N4, IE4

onselect

23

(1) Aso called the fileUpload object.

formnametypevalue

blur()focus()handleEvent( evt)N4

select()

N3,(1),IE4file input controlonbluronfocusonselect

24

Page 4: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

7

htmlFor (None)(None)

LABEL

BUTTONINPUT (button, reset, submit, radio, checkbox)

(See original object model button, reset, submit, radio, and checkbox object listings.)

completeformnamesrctype

(None)(None)

INPUT (image)

hash host hostname href Methods mimeType name nameProp pathnameportprotocolprotocolLongrelrevsearch target urn

A (anchor/link)

compactstarttype

OL

compacttype

UL

typevalue

LI

compact

DL, DT, DD, DIR, MENU

Page 2 of 4 — IE4+ DHTML DOM Quick Reference© 2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

JSB5

IE4+ DHTML DOMCompatibility Guide

The baseline browser for this section isMSIE 4. An item with no notation iscompatible back to that level for allOS versions. Notations as follows: W4 — IE4+/Windows only W5 — IE5+/Windows only IE5 — IE5+ all OSes W5.5 — IE5.5+/ Windows only W6 — IE6+/Windows only M5 — IE5+/MacAll HTML element objects shareitems from “All HTML” box on Page 1.“(None)” means no special methods orevents for the current object.

defaultSelected formselectedtextvalue

(None)

OPTION(None)

actionautocomplete W5

elements[]encodingenctypelengthmethodnametarget

onresetonsubmit

reset()submit()

FORM 21

35

22

22

maxLengthreadOnlysize

onafterupdateW4

onbeforeupdate W4

onerrorupdateW4

(None)

INPUT (text, password, hidden)(See original object model text, password, and hidden object listings.)

23

colsreadOnlyrowswrap

onafterupdateW4

onbeforeupdate W4

onerrorupdateW4

createTextRange()

TEXTAREA(See original object model textarea object listing.)

23

lengthmultiplesizevalue

(None)item(index [,subindex ]IE5

namedItem("id")W6

options[i].add( elem [,index ])options[i].remove()

SELECT(See original object model select object listing.)

24

24

37

37

37

19

alignaltbordercompletedynsrcfileCreatedDate W4,M5

fileModifiedDate W4,M5

fileSize W4,M5

fileUpdatedDate W5.5,M5

heighthrefhspaceisMaplooplowsrcmimeType W6

namenamePropW5

protocolsrcstartuseMapvspacewidth

onabortonerroronload

(None)

IMG 20

alt coordshashhosthostnamehrefnoHrefpathnameportprotocolsearchshapetarget

(None)(None)

AREA 20

areas[]name

onscroll(None)

MAP 20

behavior bgColordirection heighthspaceloopscrollAmountscrollDelaytrueSpeedvspace width

onbounceonfinishonstart

start()stop()

MARQUEE 35

Page 5: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

altKeyaltLeft IE5.5

behaviorCookie W5.5

behaviorPart W5.5

bookmarks W4

boundElementsbuttoncancelBubbleclientXclientYcontentOverflowctrlKeyctrlLeft IE5.5

dataFldW4

dataTransferW5

fromElementkeyCodenextPage W5.5

offsetXoffsetYpropertyNameW5

qualifier W4

reasonW4

recordsetW4

repeatW5

returnValuesaveType W5.5

screenXscreenYshiftKeyshiftLeft IE5.5

srcElement srcFilter W4

srcUrnW5

toElementtypewheelData W6

xy

eventmediatype

(None)(None)

STYLE

cssText IE5

disabled href id imports[]mediaowningElementpages[] W5.5

parentStyleSheetreadOnlyrules[]titletype

(None)addImport("URL"[,index ])addRule("selector ","styleSpec "[,index ])removeRule( index )

styleSheet

readOnlyselectorTextstyle

(None)(None)

rule

(See style object)

currentStyle , runtimeStyleIE5 W5.5

align height hiddennamepluginspagesrcunitswidth

onloadonscroll

(None)

EMBED

align altHTMLarchive W6 code codeBase height hspace name objectvspacewidth

oncellchange W5

ondataavailable W5

ondatasetchanged W5

ondatasetcomplete W5

onloadonrowenterW5

onrowexit W5

onrowsdelete W5

onrowsinserted W5

onscroll

(None)

APPLET

align altHTML BaseHref classid code codeBase codeTypedata heighthspacenameobjecttypevspacewidth

oncellchange W5

ondataavailable W5

ondatasetchanged W5

ondatasetcomplete W5

onloadonrowenterW5

onrowexit W5

onrowsdelete W5

onrowsinserted W5

onscroll

(None)

OBJECT

charsetdisabled href hreflang media relrevstyleSheet W5

targettype

onload(None)

LINK

defer event htmlFor src text type

(None)(None)

SCRIPT

9

Page 4 of 4 — IE4+ DHTML DOM Quick Reference© 2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

JSB5

36

36

26

26

26

26 25 40

40

40

srcXMLDocument

(None)(None)

XML 41W5

readyStateresponseTextresponseXMLstatusstatusText

(None)abort()getAllResponseHeaders()getResponseHeader()open()send()

XMLHttpRequest 41(1)

(1) Supported in W5 (via ActiveX), N7, and Safari 1.2

Page 6: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

charset (1)

coords (1)

hashhosthostnamehrefhreflang (1)

namepathnameportprotocolrelrevsearchshape (1)

targettype (1)

A (anchor/link)

(1)Not implemented in IE through 5.5.

11

Page 2 of 4 — W3C DOM (IE5+, NN6+, Mozilla, Safari) Quick Reference© 2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

JSB5

19

areasname

MAP 20

alt coordshashhosthostnamehrefnoHrefpathnameportprotocolsearchshapetarget

AREA 20

alignaltbordercompleteheighthrefhspaceisMaplongDesc (1)

lowsrclowSrc (1)

namenaturalHeight, naturalWidth N6

srcuseMapvspacewidth

onAbortonErroronLoad

(None)

IMG

(1)Not implemented in IE through 6.

compactstarttype

OLcompacttype

UL

typevalue

LI

compact

DL, DT, DD, DIR, MENU

acceptCharset (1)

actionelements[]encodingenctypelengthmethodnametarget

onresetonsubmit

reset()submit()

FORM

(1)Not implemented in IE through 6.

21

alignform

(None)(None)

FIELDSET, LEGEND 21

accessKeyformM5,W6

htmlFor

(None)(None)

LABEL 35

disabledformnamesrctype

(None)(None)

INPUT (image) 22

disabledmaxLengthreadOnlysize

(None)(None)

INPUT (text, password, hidden)(See original object model text, password, and hidden object listings.)

23

colsdisabledreadOnlyrows

(None)(None)

TEXTAREA(See original object model textarea object listing.)

23

37 37

37

20

form(1)

label (1)(None)(None)

OPTGROUP

(1)Not implemented in IE/Windows through 6, but is implemented in IE5/Mac.

24

defaultSelected disabledformlabel M5,W6

selectedtextvalue

(None)(None)

OPTION 24

disabledlengthmultiplesizevalue

(None)options[ i].remove()

SELECT(See original object model select object listing.)

24

BUTTONINPUT (button, reset, submit, radio, checkbox)

22

disabled(See original object model button, reset, submit, radio, and checkbox object listings.)

behaviordirectionscrollAmountscrollDelaywidth

MARQUEE 35

start()stop()

(1)

(1)From IE, but implemented in N7/Mozilla.

Page 7: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

altKey bubbles button cancelBubble cancelable charCode clientX clientY ctrlKeycurrentTargetdetaileventPhaseisCharkeyCodelayerXlayerYmetaKeyoriginalTargetpageXpageYrelatedTargetscreenXscreenYshiftKeytargettimeStamptypeview

(None)initEvent(" type ",bubble ,cancelable )initKeyEvent(" type ", evtArgs )initMouseEvent(" type ", evtArgs )initMutationEvent(" type ", evtArgs )initUIEvent(" type ", evtArgs )preventDefault()stopPropagation()

event (1)

(1)Not implemented in IE through 6.

mediatype

(None)(None)

STYLE

cssRules[]disabledhrefmediaownerNode(1)

ownerRule(1)

parentStyleSheettitletype

(None)deleteRule( index )(1)

insertRule("rule",index )(1)

styleSheet

(1)Not implemented in IE through 5.5.

align altW6

baseURIN7

borderW6

code codeBase codeType contentDocument (1)

heighthspacenameobjecttypevspacewidth

OBJECT

cssText (2)

parentStyleSheet (2)

selectorTextstyletype (1)

(None)(None)

cssRule

(1)Not implemented in IE through 6.(2)Not implemented in IE through 6, but implemented in IE5/Mac.

13

Page 4 of 4 — W3C DOM (IE5+, NN6+, Mozilla, Safari) Quick Reference© 2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

JSB5

W3C DOMCompatibility Guide

Baseline browsers for this section areIE5, NN6, Mozilla 1, and Safari 1. An item with no notation is compatible with these browsers (except occasionally Safari). Some items are new to Netscape 7 (N7) and Mozilla or WinIE6 (W6). Observe footnotes for items missing from IE, and see the book’s text for Safari details. All HTML element objects share items from “All HTML” box on Page 1. “(None)” means no special methods or events for the current object.

26

26

26

(1)Not implemented in IE through 6.

charsetdisabledhrefhreflangmediarelrevsheet (1)

targettype

(None)(None)

LINK 36

defereventhtmlForsrctexttype

(None)(None)

SCRIPT 36

alignheightnamewidth

onloadonscroll

(None)

EMBED 40

alignaltW6

archive W6

codecodeBasedataheighthspacenametypeuseMap W6

vspacewidth

APPLET 40 40

25

(1)Not implemented in IE through 6.

Page 8: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

(1)Method of the static String object.(2)Added behavior in N4 includes: ability to accept a regexp parameter; second parameter (limit integer) to limit the number of splits to be included; a space string parameter signifying any white space character.

constructor N4, IE4

lengthprototypeN4, J2

anchor("anchorName ")big()blink()bold()charAt(index )charCodeAt([ i])N4, IE4

concat( string2 )N4, IE4

fixed()fontcolor(# rrggbb)fontsize(1to7)fromCharCode(n1...)(1),N4, IE4

indexOf("str" [,i])italics()lastIndexOf("str" [,i])link( URL)localeCompare() N6, W5.5

match(regexp)N4, IE4

replace( regexp ,str)N4, IE4

search(regexp)N4, IE4

slice( i,j)N4, IE4

small()split( char)N3, (2), IE4

strike()sub()substr(start,length )N4, IE4

substring( intA , intB )sup()toLocaleLowerCase() N6, W5.5

toLocaleUpperCase() N6, W5.5

toLowerCase()toString()N4, IE4

toUpperCase()valueOf()N4, IE4

String

(1)Property of the static RegExp object.(2)Returns an array with properties: index, input, [0], [1],...[n].

globalignoreCase M5,W5.5

input (1), IE5.5

lastIndexmultiline (1), W5.5

lastMatch (1), W5.5

lastParen (1), W5.5

leftContext (1),W5.5

prototyperightContext (1)

source$1...$9

compile( regexp)exec("string ")(2)

test("string ")str.match(regexp)str.replace( regexp ,str)str.search( regexp)str.split( regexp [,limit ])

Regular ExpressionsN4,IE4

argumentsarityN4

callerconstructor N4, IE4

lengthprototype

apply( this , argsArray)N6, W5.5

call( this [,arg1[,...argN]])N6, W5.5

toString()valueOf()

FunctionN3,J2

prototypeconstructordescription W5

fileName N6

lineNumber N6

message N6, IE5.5

nameN6, IE5.5

numberW5

toString()

Error N6,W5

constructor N4, IE4

MAX_VALUE IE4

MIN_VALUE IE4

NaNIE4

NEGATIVE_INFINITY IE4

POSITIVE_INFINITY IE4

prototype

toExponential( n)N6, W5.5

toFixed(n)N6, IE5.5

toLocaleString() N6, W5.5,M5

toString([radix ])N4, IE4

toPrecision( n)N6, W5.5

valueOf()N4, IE4

NumberN3,J2

constructor N4, IE4

prototypeN3, IE4getFullYear()N4, J2

getYear()getMonth()getDate()getDay()getHours()getMinutes()getSeconds()getTime()getMilliseconds() N4, J2

getUTCFullYear()N4, J2

getUTCMonth()N4, J2

getUTCDate()N4, J2

getUTCDay()N4, J2

getUTCHours()N4, J2

getUTCMinutes()N4, J2

getUTCSeconds() N4, J2

getUTCMilliseconds() N4, J2

setYear(val )setFullYear( val )N4, J2

setMonth(val )setDate(val )setDay(val )setHours(val )setMinutes( val )setSeconds( val )setMilliseconds( val )N4, J2

setTime(val )setUTCFullYear(val )N4, J2

setUTCMonth(val )N4, J2

setUTCDate(val )N4, J2

setUTCDay(val )N4, J2

setUTCHours(val )N4, J2

setUTCMinutes( val )N4, J2

setUTCSeconds( val )N4, J2

setUTCMilliseconds( val )N4, J2

getTimezoneOffset()toDateString()W5.5

toGMTString()toLocaleDateString() W5.5, N6

toLocaleString()toLocaleTimeString() W5.5, N6

toString()toTimeString() IE5.5

toUTCString()N4, J2

Date.parse("dateString ")Date.UTC(date values )

Date

constructor N4, IE4

prototypetoString()N4, IE4

valueOf()N4, IE4

BooleanN3,J2

constructor N4, IE4

lengthprototype

concat( array2)N4, IE4

join("char")IE4

push()N4, W5.5

pop()N4, W5.5

reverse()IE4

shift()N4, W5.5

slice(i,[j]) N4, IE4

sort(compareFunc )IE4

splice(i,j[, items ])N4, W5.5

toLocaleString() N6, W5.5

toString()IE4

unshift()N4, W5.5

ArrayN3,J2

(1)All properties & methods are of the static Math object.

ELN2LN10LOG2ELOG10EPISQRT1_2SQRT2

abs(val )acos(val )asin(val )atan(val )atan2(val1 , val2 )ceil( val )cos(val )exp(val )floor(val )log(val )max(val1 , val2 )min(val1 , val2 )pow(val1 , power)random()round(val )sin(val )sqrt(val )tan(val )

Math(1)

FunctionsdecodeURI("encodedURI ")N6, W5.5

decodeURIComponent(" encComp ")N6, W5.5

encodeURI("URIString")N6, W5.5

encodeURIComponent(" compString ")N6, W5.5

escape("string " [,1])eval("string ") isFinite( number)N4, IE4

isNaN(expression )Number(string )N4, IE4

parseFloat("string ")parseInt("string " [,radix ])toString([radix ])unescape("string ")unwatch(prop)N4

watch(prop, handler)N4

Globals

Statements// /*...*/const N6

var

if (condition ) { statementsIfTrue}

if (condition ) { statementsIfTrue} else { statementsIfFalse}

result = condition ? expr1 : expr2

for ([init expr ]; [condition ]; [update expr]) { statements}

for (var in object ) { statements}

while (condition ) { statements}

switch ( expression ) { case labelN : statements [break] ... [default : statements ]}N4, IE4

label : N4, IE4

continue [ label ]N4, IE4

break [ label ]N4, IE4

try { statements to test}[catch ( errorInfo) { statements if exception occurs in try block}][finally { statements to run, exception or not}]N6, W5

throw value N6, W5

Control Statements

with (object ) { statements}

do { statements} while (condition )N4, IE4

2

Core JavaScript/JScript/ECMAScript Quick Reference © 2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

JSB5

30

29

27

42

28

28

28

33

34

31

31

Page 9: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

captureEvents( type )N4-Only

clear()close()getSelection() N4,(2)

handleEvent( event )N4-Only

open("mimetype " [,replace ])(3)

releaseEvents( type )N4-Only

routeEvent(event )N4-Only

write("string ")writeln("string ")

alinkColoranchors[]applets[] N3, IE4

bgColorcookiedomain N3, IE4

embeds[] N3, IE4

fgColorforms[]height N4

images[] N3, IE4

lastModifiedlayers[] N4-Only

linkColorlinks[]location (1)

referrertitleURLN3, IE4

vlinkColorwidthN4

document(None)

(1) Replaced by the URL property in Navigator 3.(2) M4 has a document.selection property to retrieve the currently selected text.(3) mimetype parameter new in M4, but only "text/html" type supported.

appCoreN6

clientInformation IE4 clipboardData W5

closed N3, IE4

components[] N6

controllers[] N6

crypto N6

defaultStatus dialogArguments IE4

dialogHeight W4

dialogLeft IE4

dialogTop IE4

dialogWidth W4

directories N4,(S)

document event IE4

external W4

frameElement W5.5

frames[] history innerHeight N4

innerWidth N4

length N6, IE4

loading N4-Only

location locationbar N4,(S)

menubarN4,(S)

name navigator N6, IE4

offscreenBuffering IE4 opener IE3, N3

outerHeight N4

outerWidth N4

pageXOffset N4

pageYOffset N4

parent personalbar N4,(S)

pkcs11 N6

prompterN6

returnValueW4,M5

screen N6, IE4

screenLeft W5

screenTop W5

screenX N6

screenY N6

scrollbars N4,(S)

scrollX N6

scrollY N6

selfsidebar N4,(S)

status statusbar N4,(S)

toolbar N4,(S)

topwindow

window

(1)New window specs for all browsers: height, width, toolbar, location, directories, status, menubar, scrollbars, resizable, copyhistory. Add'l specs for N4+: alwaysLowered(S), alwaysRaised(S), dependent, hotkeys, innerHeight, innerWidth, outerHeight, outerWidth, screenX, screenY, titlebar(S), z-lock(S). Add'l specs for IE4+: channelmode, fullscreen, left, top. Add'l spec for IE5+: title. N6 + includes left, top.(2)Optional args parameter added to N4; 3rd parameter in IE4 is for scripting language.

4

Original DOM (NN2+, IE3+) Quick Reference — Page 1 of 2 © 2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

JSB5

alert("msg ")attachEvent(" evt",func )IE5

back()N4

blur()N3, IE4

captureEvents(type) N4-Only

clearInterval(ID) N4, IE4

clearTimeout(ID)close()confirm("msg ")createPopup()W5.5

detachEvent(" evt",func )IE5

disableExternalCapture() N4-Only

enableExternalCapture() N4-Only

execScript(" exprs "[,lang ])IE4

find(["str"][,case , bkwd ])N4

fireEvent("evt"[,evtObj ])W5.5

focus()N3, IE4

forward() N4

handleEvent( event )N4-Only

home()N4

moveBy(∆ x,∆y)N4, IE4

moveTo(x,y)N4, IE4

navigate() IE3

open(URL,"name","specs ")(1),(S)

print()N4, IE5

prompt("msg ","reply ")releaseEvents( type )N4-Only

resizeBy(∆ x,∆y)N4-Only, IE4

resizeTo(width ,height )N4-Only, IE4

routeEvent(event )N4-Only

scroll( x,y)N3, IE4

scrollBy(∆ x,∆y)N4, IE4

scrollTo( x,y)N4, IE4

setActive() W5.5

setInterval( func , msec [,args])N4,IE4,(2)

setTimeout( func , msec [,args])(2)

showHelp()W4

showModalDialog() IE4

showModelessDialog() W5

sizeToContent() N6

stop()N4

onabortN6

onafterprintW5

onbeforeprintW5

onbeforeunload IE4

onblurN3, IE4

onchange N6

onclick N6

onclose N6

ondragdropN4-Only

onerrorN3, IE4

onfocus N3, IE4

onhelp IE4

onkeydown N6

onkeypress N6

onkeyup N6

onloadonmousesdown N6

onmousemove N6

onmouseout N6

onmouseover N6

onmouseup N6

onmove N4-Only

onresetN6

onresize N4, IE4

onscroll IE4

onselect N6

onsubmit N6

onunload

16 18

abovebackgroundbelowbgColorclip.bottomclip.heightclip.leftclip.rightclip.topclip.widthdocumentleftnamepageXpageYparentLayersiblingAbovesiblingBelowsrctopvisibilityzIndex

layerN4-Only

load("filename ", y)moveAbove( layerObj )moveBelow( layerObj )moveBy(∆ x, ∆y)moveTo(x, y)moveToAbsolute( x, y)resizeBy(∆ x, ∆y)resizeTo(width , height )

onbluronfocusonloadonmouseoutonmouseoveronmouseup

39

locationassign("URL")reload([unconditional ])N3,IE4

replace("URL")N3,IE4

hashhosthostnamehrefpathnameportprotocolsearch

(None)

17

historycurrent(S),(1)

lengthnext (S),(1)

previous (S),(1)

back()forward()go(int | "URL")

(None)

(1) Available in NN4+/Mozilla with signed scripts.

17

hashhosthostnamehrefpathnameportprotocolsearchtarget

onclick N4

onmouseoutonmouseover

N3,IE4area(None)

20

bordercompleteheighthspacelowsrcnamesrcvspacewidthxN4-Only

yN4-Only

imageN3,(1),IE4

onabortonerroronload

(None)

(1) Implemented in IE3.01/Macintosh but not Windows until IE4.

20

nameN4, IE4

textN4-Only

xN4-Only

yN4-Only

(None) (None)

anchor ( <a name=...></a> ) 19

hashhosthostnamehrefpathnameportprotocolsearchtargettextN4-Only

xN4-Only

yN4-Only

onclickondblclick N4,(1),IE4

onmousedown N4, IE4

onmouseout N4, IE4

onmouseoveronmouseup N4, IE4

(None)

(1) Not implemented in NN4/Mac.

link ( <a href=...></a> ) 19

Page 10: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

accessKey all[] behaviorUrns[] W5

canHaveChildren W5

canHaveHTML W5.5

children className clientHeight clientLeft clientTop clientWidth contentEditable W5.5

currentStyle IE5

dataFld W4,M5

dataFormatAs W4,M5

dataSrcW4,M5

disabled document filters[] W4

hideFocus W5.5

id innerHTML innerText isContentEditable W5.5

isDisabled W5.5

isMultiLine W5.5

isTextEdit W4

lang language length (1)

offsetHeight offsetLeft offsetParent offsetTop offsetWidth outerHTML outerText parentElementparentTextEditreadyStaterecordNumberW4

runtimeStyle IE5

scopeName W5

scrollHeightscrollLeftscrollTopscrollWidthsourceIndexstyletabIndextagNametagUrnW5

titleuniqueID W5

onactivate W5.5

onbeforecopy W5

onbeforecut W5

onbeforedeactivate W5.5

onbeforeeditfocus W5

onbeforepaste W5

onbluronclickoncontextmenu W5

oncontrolselect W5.5

oncopy W5

oncutW5

ondblclickondeactivate W5.5

ondragW5

ondragendW5

ondragenterW5

ondragleave W5

ondragoverW5

ondragstartW5

ondropW5

onfilterchange W4

onfocusonfocusin W6(2)

onfocusout W6(2)

onhelp W4,M5

onkeydownonkeypressonkeyuponlosecapture W5

onmousedownonmouseenter W5.5

onmouseleave W5.5

onmousemoveonmouseoutonmouseoveronmouseuponmousewheel W6

onmove W5.5(2)

onmoveend W5.5(2)

onmovestart W5.5(2)

onpaste W5

onpropertychange W5

onreadystatechangeonresizeonresizeend W5.5

onresizestart W5.5

onselectstart

addBehavior("URL") W5

applyElement( elem [,type ])W5

attachEvent(" evt",func )W5

blur() clearAttributes() W5

click() componentFromPoint( x,y)W5

contains( elem ) detachEvent(" evt",func ) W5

fireEvent("evt"[,evt ])W5.5

focus() getAdjacentText() W5

getAttribute("attr"[,case ]) getBoundingClientRect() W5

getClientRects() W5

getExpression() W5

insertAdjacentElement() W5

insertAdjacentHTML() insertAdjacentText() item(index [,subindex ])(1)

mergeAttributes() W5

releaseCapture()W5

removeAttribute("attr"[,case ]) removeBehavior( ID)W5

removeExpression(" prop")W5

removeNode(children )W5

replaceAdjacentText(" loc ","txt") W5

replaceNode( new)W5

scrollIntoView( top) setActive() W5.5

setAttribute("attr",val [,case ]) setCapture(container )W5

setExpression(" prop","expr","lang ") W5

swapNode(node)W5

tags("tag") (1)

urns("URN")W5,(1)

All HTML Elements

(1)Property or method of all object collections. (2)IE content editing mode only.

documentisOpen

(None)hide()show()

popupW5.5

colorfacesize

BASEFONT

text

TITLE

hreftarget

BASE

6

IE4+ DHTML DOM Quick Reference — Page 1 of 4 © 2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

JSB5

borderborderColorcolsframeBorderframeSpacingrows

FRAMESET

charset content httpEquiv name url

META

15

16

alignallowTransparency W6

contentWindow W5.5

height, widthhspace, vspacelongdesc W6,M5

marginHeightmarginWidthnamescrollingsrc

IFRAME 16

allowTransparency W6

borderColor contentWindow W5.5

frameBorder height, widthmarginHeight W6,M5

marginWidth W6,M5

namenoResize scrollingsrc

FRAME 16

16

36

36

36

36

alink background bgColor bgProperties bottomMargin leftMargin, rightMarginlink noWrapscrollscrollLeft, scrollToptexttopMarginvLink

onAfterPrint W5

onBeforePrint W5

onScroll

createControlRange()W5

createTextRange()doScroll(["scrollAction "])W5

BODY 18

activeElement alinkColor all anchors[] applets[] bgColor body charsetcompatMode W6

cookie defaultCharset designMode W5

doctype M5 domain embeds[] expando fgColor fileCreatedDate fileModifiedDate fileSize forms[] frames[] images[] lastModified linkColor links[] locationmedia W5.5

mimeType W5

namePropW6

namespaces[] W5.5

parentWindow plugins[] protocol readyState referrer scripts[]security W5.5

selection styleSheets[] title uniqueID URL URLUnencoded W5.5

vlinkColor

onactivate W5.5

onbeforecut W5

onbeforedeactivate W5.5

onbeforeeditfocus W5

onbeforepaste W5

onclickoncontextmenu W5

oncontrolselect W5.5

oncutondblclickondeactivate W5.5

ondragW5

ondragendW5

ondragenterW5

ondragleave W5

ondragoverW5

ondragstartW5

ondropW5

onhelp W4,M5

onkeydownonkeypressonkeyuponmousedownonmousemoveonmouseoutonmouseoveronmouseuponpasteonpropertychange W5

onreadystatechangeonresizeend W5.5

onresizestart W5.5

onselectionchange W5.5

onstop IE5

attachEvent(" evt",func )IE5

clear() clearAttributes() IE5

close() createElement(" tag") createEventObject([ evt ])W5.5

createStyleSheet([" URL"[,index ]]) detachEvent(" evt",func )IE5

elementFromPoint( x,y) execCommand(" cmd "[,UI][,arg]) focus() mergeAttributes( obj)W5

open(["mimeType "[,replace ]) queryCommandEnabled(" cmd ") queryCommandIndterm("cmd ") queryCommandState(" cmd ") queryCommandSupported(" cmd ") queryCommandText("cmd ") queryCommandValue(" cmd ") recalc( allFlag )W5

releaseCapture() IE5

setActive() W5.5

write("str") writeln("str")

document 18

Page 11: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

alignbgColorrowsvAlign

(None)deleteRow( i)insertRow( i)moveRow(srcIndex ,destIndex )

i

TBODY, TFOOT, THEAD

alignbackgroundbgColorborderborderColorborderColorDarkborderColorLightcaptioncellPaddingcells[] W5

cellSpacingcols[]datePageSizeframeheightrows[]rulestBodies[]tFoottHeadwidth

onscrollcreateCaption()createTFoot()createTHead()deleteCaption()deleteRow(i)deleteTFoot()deleteTHead()firstPage() IE5

insertRow( i)lastPage() IE5

moveRow(srcIndex ,destIndex )W5

nextPage()W4,M5

previousPage() W4,M5

refresh()

TABLE

alignvAlign

CAPTION

alignspanvAlignwidth

COL, COLGROUPalignbackgroundbgColorborderColorborderColorDarkborderColorLightcellIndexcolSpanheightnoWraprowSpanvAlignwidth

TD, TH

alignbgColorborderColorborderColorDarkborderColorLightcells[]heightrowIndexsectionRowIndexvAlign

(None)deleteCell( i)insertCell( i)

TR

colorfacesize

FONT

aligncolornoShadesizewidth

HR

align

H1...H6

BRclear

boundingHeightboundingLeft boundingTop boundingWidthhtmlText offsetLeftoffsetToptext

(None)collapse([ start])compareEndPoints(" type ",range)duplicate()execCommand(" cmd "[,UI[,val ]])expand("unit")findText("str"[,scope ,flags ])getBookmark()getBoundingClientRect()getClientRects()inRange(range)isEqual( range)move("unit"[,count ])moveEnd("unit"[,count ])moveStart("unit"[,count ])moveToBookmark(" bookmark ")moveToElementText( elem )moveToPoint( x,y)parentElement()pasteHTML("HTMLText")queryCommandEnabled(" cmd ")queryCommandIndeterm("cmd ")queryCommandState(" cmd ")queryCommandSupported(" cmd ")queryCommandText("cmd ")queryCommandValue(" cmd ")scrollIntoView()select()setEndPoint(" type ",range)

TextRangeW4

typetypeDetail W5.5

(None)clear()createRange()empty()

selectionW4

data length nextSibling nodeName nodeType nodeValue parentNodepreviousSibling

(None)appendData("text")M5,W6

deleteData(start, count )M5,W6

insertData(start, "text")M5,W6

replaceData(start, count , "text")M5,W6

splitText( offset )M5,W6

substringData( start, count )M5,W6

TextNode IE5

bottomleftrighttop

(None)(None)

TextRectangleW5

8

IE4+ DHTML DOM Quick Reference — Page 3 of 4© 2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

JSB5

IE4+ DHTML DOMCompatibility Guide

The baseline browser for this section isMSIE 4. An item with no notation iscompatible back to that level for allOS versions. Notations as follows: W4 — IE4+/Windows only W5 — IE5+/Windows only IE5 — IE5+ all OSes W5.5 — IE5.5+/Windows only M5 — IE5+/MacAll HTML element objects shareitems from “All HTML” box on Page 1.“(None)” means no special methods orevents for the current object.This Quick Reference does not contain listings for Microsoft’s separate XML DOM.

37

37

35

35

35

35

37

3737

37

35

35

35

35

Page 12: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

attributes[]childNodes[]classNameclientHeight (1)

clientLeft (1)

clientTop (1)

clientWidth (1)

dirfirstChildidinnerHTML(1)

langlastChildlength (3)

localNamenamespaceURInextSiblingnodeNamenodeTypenodeValueoffsetHeight (1)

offsetLeft (1)

offsetParent (1)

offsetTop (1)

offsetWidth (1)

ownerDocumentparentNodeprefixpreviousSiblingscrollHeight, scrollLeft, scrollTop, scrollWidth (1)

styletabIndextagNametitle

onbluronclickoncontextmenu (1)

ondblclickonfocusonkeydownonkeypressonkeyuponmousedownonmousemoveonmouseoutonmouseoveronmouseuponresize

addEventListener(" evt",func ,capt )(2)

appendChild( elem )blur()click()cloneNode( deep)dispatchEvent( evt)(2)

focus()getAttribute("attr")getAttributeNode("attr")W6

getAttributeNodeNS("nsuri ","local ")(2)

getAttributeNS("nsuri ","local ")(2)

getElementsByTagName(" tag")hasAttribute("attr")(2)

hasAttributeNS(" nsuri ","local ")(2)

hasAttributes() (2)

hasChildNodes()insertBefore(new[,ref])isSupported(" feature","ver")(2)

item(index )(3)

normalize() (2)

removeAttribute("attr")removeAttributeNode( node)(2)

removeChild( node)removeEventListener(" evt",func ,capt )(2)

replaceChild( new,old)scrollIntoView() (1)

setAttribute("attr",val )setAttributeNode( node)(2)

All HTML Elements

(1)Non-W3C item originated in IE4 Object Model, but implemented in N6+/Moz/Saf for convenience.(2)Not implemented in IE through 6. (3)Property or method of all object collections.

(1)Not implemented in IE through 6.

profile (1)

HEAD

hreftarget

BASE

colorfacesize

BASEFONT

charset contenthttpEquivnamescheme M5,W6

url

META

10

W3C DOM (IE5+, NN6+, Mozilla, Safari) Quick Reference — Page 1 of 4 © 2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

JSB5

W3C DOMCompatibility Guide

Baseline browsers for this section areIE5, NN6, Mozilla 1, and Safari 1. An item with no notation is compatible with these browsers (except occasionally Safari). Some items are new to Netscape 7 (N7) and Mozilla or WinIE6 (W6). Observe footnotes for items missing from IE, and see the book’s text for Safari details. All HTML element objects share items from “All HTML” box on Page 1. “(None)” means no special methods or events for the current object.

15 36

36

36

36

text

TITLE 36

(1)Not implemented in IE through 6.

version (1) (None)(None)

HTML 36

colsrows

(None)(None)

FRAMESET 16

(1)Not implemented in IE through 6.

contentDocument (1)

contentWindow N7

frameBorderlongDesc M5,N6

marginHeight, marginWidthnamenoResizescrollingsrc

(None)(None)

FRAME 16

(1)Not implemented in IE through 6.

aligncontentDocument (1)

longDesc M5,W6

marginHeightmarginWidthscrollingsrc

IFRAME 16

alinkColoranchors[]applets[]attributes[]bgColorbodycharacterSet (1)

childNodes[]compatMode W6,N7

cookiedefaultView (1)

doctype (1)

documentElementdomainembeds[]fgColorfirstChildforms[]height (1)

images[]implementation (1)

lastChildlastModifiedlinkColorlinks[]locationnamespaceURInextSiblingnodeNamenodeTypeownerDocument (1)

parentNodeplugins[]previousSiblingreferrerstyleSheets[]title URLvlinkColorwidth (1)

onbluronclickondblclickonfocusonkeydownonkeypressonkeyuponmousedownonmousemoveonmouseoutonmouseoveronmouseuponresize

clear()close()createAttribute("name")createComment("text")W6

createDocumentFragment() W6

createElement(" tag")createEvent(" type ")(1)

createRange()(1)

createTextNode("txt")createTreeWalker( root, what, filterFunc , expand )N7,(1)

focus()getElementById(" ID")getElementsByName(" name")getElementsByTagName(" tag")open("mimeType "[,replace ])write("str")writeln("str")

document

(1)Not implemented in IE through 6.

18

alink background bgColor linkscrollLeft, scrollTop N7,(1)

textvLink

(None)(None)

BODY 18

(1)Originated in IE Object Model, but implemented in N7/Mozilla for convenience.

Page 13: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

clear

BR

align

H1...H6

cite M5,W6

BLOCKQUOTE, Q

colorfacesize

FONT

aligncolornoShadesizewidth

HR

(None)alignbgColorbordercaptioncellPaddingcellSpacingframeheightrows[]rulessummary W6

tBodiestFoottHeadwidth

onscrollcreateCaption()createTFoot()createTHead()deleteCaption()deleteRow( i)deleteTFoot()deleteTHead()insertRow( i)

TABLE

alignvAlign

CAPTION

deleteRow( i)insertRow( i)

alignbgColorchW6

chOffW6

rowsvAlign

(None)

TBODY, TFOOT, THEAD

collapsedcommonAncestorContainerendContainerendOffsetstartContainerstartOffet

cloneContents() N7

cloneRange() N7

collapse([ start])compareBoundaryPoints( type ,src)N7

compareNode(node)comparePoint( node, offset )createContextualFragment(" text")deleteContents()detach()extractContents() N7

insertNode(node)N7

intersectsNode( node)isPointInRange( node, offset )selectNode( node)selectNodeContents( node)setEnd(node,offset )setEndAfter( node)setEndBefore( node)setStart(node,offset )setStartAfter(node)setStartBefore(node)surroundContents( node)N7

toString()

Range(1)

(1)Not implemented in IE through 6.

alignchW6

chOffW6

spanvAlignwidth

COL, COLGROUP

alignbgColorcells[]chW6

chOffW6

rowIndexsectionRowIndexvAlign

(None)deleteCell( i)insertCell( i)

TR

abbrM5,W6

alignaxis M5,W6

backgroundbgColorcellIndexchW6

chOffW6

colSpanheadersM5,W6

heightnoWraprowSpanvAlignwidth

TD, TH

12

W3C DOM (IE5+, NN6+, Mozilla, Safari) Quick Reference — Page 3 of 4 © 2004 Danny Goodman (www.dannyg.com). All Rights Reserved.

JSB5

37

37

37

35

35

35

35

35

37 37

37

Node TypesELEMENT_NODEATTRIBUTE_NODETEXT_NODECDATA_SECTION_NODEENTITY_REFERENCE_NODEENTITY_NODEPROCESSING_INSTRUCTION_NODECOMMENT_NODEDOCUMENT_NODEDOCUMENT_TYPE_NODEDOCUMENT_FRAGMENT_NODENOTATION_NODE

123456789

101112

35

datalength

(None)appendData("text") deleteData(offset ,count ) insertData(offset ,"text") replaceData(offset ,count ,"text")splitText( offset )substringData( offset ,count )

Text (1)

(1)Not implemented in IE through 6.

35

anchorNodeanchorOffsetfocusNodefocusOffsetisCollapsedrangeCount

(None)addRange(range)clearSelection()collapse( node,offset )collapseToEnd()collapseToStart()containsNode( node,recurse)deleteFromDocument()extend(node,offset )getRangeAt()removeAllRanges()removeRange( range)selectAllChildren( node)toString()

selection(1)

(1)Not implemented in IE through 6.

35

(None)

Page 14: JavaScript Bible 5th Edition Quick Reference · This guide contains quick reference info for the core JavaScript language, the original document object model (2 pp), the IE4+DHTML

The New 5th Edition of the BestsellerPublished March 2004

ISBN 0-7645-5743-2

If JavaScript can do it, you can do it too . . .Create Web pages brimming with dynamic content. Engage your site visitors with programmed style sheets that respond instantly to user interaction. Take charge of your user interface by controlling CSS, plug-ins, Java™ applets, and even XML data. Premier JavaScript authority Danny Goodman teams up with developer/inventor Michael Morrison to help you bring your pages to life, whether you’re a beginner or a JavaScript pro. You’ll find what you need in this extensively revised edition — an updated, standards-intensive tutorial for newcomers, and plenty of advanced detail for veterans.

Inside, you’ll find complete coverage of JavaScript• Get up to speed fast on JavaScript basics with an updated tutorial tailored for newcomers• Master JavaScript and DOM concepts with Danny Goodman’s exclusive interactive workbench, The Evaluator• Apply scripting to Web standards — XHTML, DOM, CSS, and XML — to produce future-compatible pages• Implement cross-browser dynamic HTML applications for MSIE 6, Mozilla™, Safari™, and other browsers• Energize your content with custom objects, XML data, and other client-side techniques• Learn in depth from hundreds of fully scripted example HTML pages