The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by , 2017-07-13 08:05:17

JavaScript

JavaScript

576 Appendix A

taintEnabled - = _ + ] { }

Number Object - = _ + ] { }

MAX_VALUE -=_+]{}

MIN_VALUE -=_+]{}

NaN - = _ + ] { }
- = _ + ] { }NEGATIVE_INFINITY
- = _ + ] { }POSITIVE_INFINITY
-=_+]{}
constructor
-=_+]{}
prototype
_+{}
toExponential
_+{}
toFixed
-=_+
toLocaleString
_+{}
toPrecision
]{}
toSource
-=_+]{}
toString
-=_+]{}
valueOf

Object Object - = _ + { }

prototype -=_+]{}

constructor - = _ + ] { }
_ +propertyIsEnumerable
eval ] { }
_ +isPrototypeOf
_ +hasOwnProperty
- = _ +toLocaleString
]{}
toSource
-toString = _ + ] { }
]{}
unwatch
-valueOf = _ + ] { }
watch ] { }

Option Object - = _ + ] { }
defaultSelected - = _ + ] { }

JavaScript Quick Reference 577

index - = _ + ] { }
form - = _ + { }
]length
-selected = _ + ] { }
text - = _ + ] { }
value - = _ + ] { }
=remove _ + { }

Password Object - = _ + ] { }

defaultValue - = _ + ] { }
form - = _ + ] { }
maxLength - = _ + { }
name - = _ + ] { }
-=_+{}
readOnly
size - = _ + { }
type - = _ + ] { }
value - = _ + ] { }
blur - = _ + ] { }
focus - = _ + ] { }
]handleEvent
select - = _ + ] { }

Plugin Object - = _ + ] { }

description - = _ + ] { }
-=_+]{}
filename
length - = _ + ] { }
name - = _ + ] { }
refresh - = _ + ] { }

Radio Object - = _ + ] { }
-checked = _ + ] { }
defaultChecked - = _ + ] { }
form - = _ + ] { }

578 Appendix A

name - = _ + ] { }
type - = _ + ] { }
value - = _ + ] { }
blur - = _ + ] { }
click - = _ + ] { }
focus - = _ + ] { }
]handleEvent

Range Object { } {}
{}
collapsed {}
commonAncestorContainer {}
endContainer {}
endOffset {}
startContainer {}
startOffset {}
createRange {}
setStart {}
setEnd {}
setStartBefore {}
setStartAfter {}
setEndBefore {}
setEndAfter {}
selectNode {}
selectNodeContents {}
collapse {}
cloneContents {}
deleteContents {}
extractContents {}
insertNode {}
surroundContents {}
compareBoundaryPoints
cloneRange

JavaScript Quick Reference 579

detach {}
toString {}

RegExp Object - = _ + ] { }

] { }constructor
global ] { }
]{}
ignoreCase
index - = _ +
input - = _ + ]
-=_+]{}
lastIndex
_+]
lastMatch
_+]
lastParen
_+]
leftContext
]{}
multiline
]{}
prototype
_ + ]rightContext
source ] { }
]compile
exec ] { }
test ] { }
]{}
toSource
] { }toString
]valueOf

Regular Expression Object - = _ +

_ +global
_+
ignoreCase
_+
multiline
source - = _ +
-compile = _ +
exec - = _ +
test - = _ +

580 Appendix A

Reset Object - = _ + ] { }
form - = _ + ] { }
name - = _ + ] { }
type - = _ + ] { }
value - = _ + ] { }
blur - = _ + ] { }
click - = _ + ] { }
focus - = _ + ] { }
]handleEvent

screen Object - = _ + ] { }

availHeight -=_+]{}

availLeft ]{}

availTop ]{}

availWidth -=_+]{}

bufferDepth -=_+

colorDepth -=_+]{}

- = _ +fontSmoothingEnabled
height - = _ + ] { }
left { }
-=_+]{}
pixelDepth
top { }
-=_+
updateInterval
width - = _ + ] { }

Script Object - = _ + { }

defer - = _ + { }
event - = _ + { }
-=_+{}
htmlFor
-=_+{}
language
src - = _ + { }

JavaScript Quick Reference 581

text - = _ + { }
type - = _ + { }

Select Object - = _ + ] { }

form - = _ + ] { }
length - = _ + ] { }
-=_+{}
multiple
name - = _ + ] { }
-options = _ + ] { }
selectedIndex - = _ + ] { }
size - = _ + { }
type - = _ + ] { }
value - = _ + { }
blur - = _ + ] { }
focus - = _ + ] { }
]handleEvent

String Object - = _ + ] { }

constructor -=_+]{}

length - = _ + ] { }
-=_+]{}
prototype
anchor - = _ + ] { }
big - = _ + ] { }
blink - = _ + ] { }
bold - = _ + ] { }
charAt - = _ + ] { }
_+]{}
charCodeAt
concat - = _ + ] { }
fixed - = _ + ] { }
-=_+]{}
fontcolor
-=_+]{}
fontsize
-=_+]{}
fromCharCode

582 Appendix A

indexOf -=_+]{}
italics -=_+]{}
lastIndexOf -=_+]{}
link -=_+]{}
localeCompare _+{}
match -=_+]{}
replace -=_+]{}
search -=_+]{}
slice -=_+]{}
small -=_+]{}
split -=_+]{}
strike -=_+]{}
sub -=_+]{}
substr -=_+]{}
substring -=_+]{}
sup -=_+]{}
toLocaleLowerCase _+
toLocaleUpperCase _+
toLowerCase -=_+]{}
toUpperCase -=_+]{}
toSource ]{}
toString -=_+]{}
valueOf -=_+]{}

Style Object - = _ + { }

accelerator {}

azimuth {}

align -=_+{}
background -=_+{}
backgroundAttachment -=_+{}
backgroundColor

JavaScript Quick Reference 583

backgroundImage -=_+{}
backgroundPosition -=_+{}
backgroundPositionX -=_+
backgroundPositionY -=_+
backgroundRepeat -=_+{}
border -=_+{}
borderBottom -=_+{}
borderBottomColor -=_+{}
borderBottomStyle -=_+{}
borderBottomWidth -=_+{}
borderCollapse {}
borderColor -=_+{}
borderLeft -=_+{}
borderLeftColor -=_+{}
borderLeftStyle -=_+{}
borderLeftWidth -=_+{}
borderRight -=_+{}
borderRightColor -=_+{}
borderRightStyle -=_+{}
borderRightWidth -=_+{}
borderSpacing {}
borderStyle -=_+{}
borderTop -=_+{}
borderTopColor -=_+{}
borderTopStyle -=_+{}
borderTopWidth -=_+{}
borderWidth -=_+{}
bottom =_+{}
captionSide {}
clear -=_+{}
clip -=_+{}
color -=_+{}

584 Appendix A

content {}
counterIncrement {}
counterReset {}
cssFloat {}
cssText -=_+{}
cue {}
cueAfter {}
cueBefore {}
cursor -=_+{}
direction =_+{}
display -=_+{}
elevation {}
emptyCells {}
font -=_+{}
fontFamily -=_+{}
fontSize -=_+{}
fontSizeAdjust {}
fontStretch {}
fontStyle -=_+{}
fontVariant -=_+{}
fontWeight -=_+{}
height -=_+{}
left -=_+{}
length {}
letterSpacing {}
lineHeight -=_+{}
listStyle -=_+{}
listStyleImage -=_+{}
listStylePosition -=_+{}
listStyleType -=_+{}
margin -=_+{}
marginBottom -=_+{}

JavaScript Quick Reference 585

marginLeft -=_+{}
marginRight -=_+{}
marginTop -=_+{}
markerOffset {}
marks {}
maxHeight {}
maxWidth {}
media {}
minHeight {}
minWidth {}
MozBinding {}
MozOpacity {}
orphans {}
outline {}
outlineColor {}
outlineStyle {}
outlineWidth {}
overflow -=_+{}
padding -=_+{}
paddingBottom -=_+{}
paddingLeft -=_+{}
paddingRight -=_+{}
paddingTop -=_+{}
page {}
pageBreakAfter -=_+{}
pageBreakBefore -=_+{}
pageBreakInside {}
parentRule {}
pause {}
pauseAfter {}
pauseBefore {}
pitch {}

586 Appendix A

pitchRange {}
playDuring {}
pixelHeight -=_+
pixelLeft -=_+
pixelTop -=_+
pixelWidth -=_+
posHeight -=_+
position -=_+{}
posLeft -=_+
posTop -=_+
posWidth -=_+
quotes {}
richness {}
right =_+{}
size {}
speak {}
speakHeader {}
speakNumeral {}
speakPunctuation {}
speechRate {}
stress {}
styleFloat -=_+
tableLayout =_+{}
textAlign -=_+{}
textDecoration -=_+{}
textDecorationBlink -=_+
textDecorationLineThrough -=_+
textDecorationNone -=_+
textDecorationOverline -=_+
textDecorationUnderline -=_+
textIndent -=_+{}
textShadow {}

JavaScript Quick Reference 587

textTransform -=_+{}
top -=_+{}
type {}
unicodeBidi =_+{}
verticalAlign -=_+{}
visibility -=_+{}
voiceFamily {}
volume {}
whiteSpace -=_+{}
widows {}
width -=_+{}
wordSpacing -=_+{}
zIndex -=_+{}

styleSheet Object - = _ + { }

cssRules =_+{}

-disabled = _ + { }
href - = _ + { }
id - = _ +
-imports = _ +
media - = _ + { }
- = _ +owningElement
{ }ownerNode
{}
ownerRule
- = _ + { }parentStyleSheet
-=_+
readOnly
rules - = _ +
title - = _ + { }
type - = _ + { }
addImport - = _ + { }
-addRule = _ + { }

588 Appendix A

removeRule -=_+{}
deleteRule {}
insertRule {}

Submit Object - = _ + ] { }
form - = _ + ] { }
name - = _ + ] { }
type - = _ + ] { }
value - = _ + ] { }
blur - = _ + ] { }
click - = _ + ] { }
focus - = _ + ] { }
]handleEvent

Text Object - = _ + ] { }

defaultValue - = _ + ] { }
form - = _ + ] { }
maxLength - = _ + { }
name - = _ + ] { }
-=_+{}
readOnly
size - = _ + { }
type - = _ + ] { }
value - = _ + ] { }
blur - = _ + ] { }
click - = _ + ] { }
focus - = _ + ] { }
]handleEvent
select - = _ + ] { }

Textarea Object - = _ + ] { }
cols - = _ + { }
defaultValue - = _ + ] { }
form - = _ + ] { }

JavaScript Quick Reference 589

name - = _ + ] { }
-=_+{}
readOnly
rows - = _ + { }
type - = _ + ] { }
value - = _ + ] { }
wrap - = _ + { }
blur - = _ + ] { }
click - = _ + ] { }
- = _ +createTextRange
focus - = _ + ] { }
]handleEvent
select - = _ + ] { }

window Object - = _ + ] { }

clientInformation -=_+

closed - = _ + ] { }
{}
content
{}
Components
{}
controllers
]{}
crypto
-=_+]{}
defaultStatus
-=_+
dialogArguments
-=_+
dialogHeight
-=_+
dialogLeft
-=_+
dialogTop
-=_+
dialogWidth
{}
directories
-=_+]{}
document
event - = _ +
-=_+
external
frames - = _ + ] { }
-=_+]{}
history

590 Appendix A

innerHeight ]{}
innerWidth ]{}
length -=_+{}
location -=_+]{}
locationbar ]{}
menubar ]{}
name -=_+]{}
navigator -=_+{}
offscreenBuffering -=_+
opener -=_+]{}
outerHeight ]{}
outerWidth ]{}
pageXOffset ]{}
pageYOffset ]{}
parent -=_+]{}
personalbar ]{}
pkcs11 {}
prompter {}
screen -=_+{}
screenX ]{}
screenY ]{}
scrollbars ]{}
scrollX {}
scrollY {}
self -=_+]{}
sidebar {}
status -=_+]{}
statusbar ]{}
toolbar ]{}
top -=_+]{}
alert -=_+]{}
atob ]

JavaScript Quick Reference 591

back ]{}
blur -=_+]{}
btoa ]
captureEvents ]{}
clearInterval -=_+]{}
clearTimeout -=_+]{}
close -=_+]{}
confirm -=_+]{}
dump {}
crypto.random ]
crypto.signText ]
disableExternalCapture ]
dump {}
enableExternalCapture ]
escape {}
find ]
focus -=_+]{}
forward ]{}
GetAttention {}
getSelection {}
handleEvent ]
home ]{}
moveBy -=_+]{}
moveTo -=_+]{}
navigate -=_+
open -=_+]{}
print -=_+]{}
prompt -=_+]{}
releaseEvents ]{}
resizeBy -=_+]{}
resizeTo -=_+]{}
routeEvent ]

592 Appendix A

scroll -=_+]{}
scrollBy -=_+]{}
scrollByLines {}
scrollByPages {}
scrollTo -=_+]{}
setCursor {}
setHotKeys ]
setInterval -=_+]{}
setResizable ]
setTimeout -=_+]{}
sizeToContent {}
setZOptions ]
stop ]{}
unescape {}
updateCommands {}

Appendix B

CSS Quick Reference

The following reference outlines the properties and pseudo-classes and elements in the cas-
cading style sheets level. The following icons are used to indicate browser compatibility:

Icon Browser

[ Netscape 3
] Netscape 4
{ Netscape 6
} Netscape 7 and above
- Microsoft Internet Explorer 4
= Microsoft Internet Explorer 5
_ Microsoft Internet Explorer 5.5
+ Microsoft Internet Explorer 6

By no means is this a comprehensive reference but instead provides a quick reference to the
properties that are most commonly used in CSS. It is possible that browser support is only
partial if a property is listed as supported by a particular browser. Also, these compatibility
listings are based on the Windows version of browsers; slight inconsistencies may exist
between versions of the same browser on different operating systems.

background property - = _ + ] { }

background-attachment property - = _ + { }
scroll - = _ + { }
fixed - = _ + { }

background-color property - = _ + { }
transparent - = _ + { }

background-image property - = _ + ] { }
none - = _ + ] { }

594 Appendix B

background-position property - = _ + { }
bottom - = _ + { }
center - = _ + { }
left - = _ + { }
right - = _ + { }
top - = _ + { }

background-repeat property - = _ + ] { }
repeat = _ + ] { }
repeat-x = _ + ] { }
repeat-y = _ + ] { }
no-repeat - = _ + ] { }

border property - = _ + ] { }

border-bottom property - = _ + { }

border-bottom-width property - = _ + { }
medium - = _ + { }
thick - = _ + { }
thin - = _ + { }

border-color property - = _ + ] { }

border-left property - = _ + { }

border-left-width property - = _ + ] { }
medium - = _ + ] { }
thick - = _ + ] { }
thin - = _ + ] { }

border-right property - = _ + { }

border-right-width property - = _ + ] { }
medium - = _ + ] { }
thick - = _ + ] { }
thin - = _ + ] { }

CSS Quick Reference 595

border-style property - = _ + ] { }
dashed _ + { }
dotted _ + { }
double - = _ + ] { }
groove - = _ + ] { }
inset - = _ + ] { }
none - = _ + ] { }
outset - = _ + ] { }
ridge - = _ + ] { }
solid - = _ + ] { }

border-top property - = _ + { }

border-top-width property - = _ + ] { }
medium - = _ + ] { }
thick - = _ + ] { }
thin - = _ + ] { }

border-width property - = _ + ] { }
medium - = _ + ] { }
thick - = _ + ] { }
thin - = _ + ] { }

clear property - = _ + ] { }
both - = _ + ] { }
left _ + { }
none - = _ + ] { }
right _ + { }

color property - = _ + ] { }

display property - = _ + ] { }
block _ + { }
inline _ + { }
+ { }list-item

596 Appendix B

none - = _ + ] { }

float property - = _ + ] { }
left _ + { }
none - = _ + ] { }
right _ + { }

font property - = _ + ] { }

font-family property - = _ + ] { }
cursive - = _ + { }
fantasy - = _ + { }
monospace - = _ + { }
sans-serif - = _ + ] { }
serif - = _ + ] { }

font-size property - = _ + ] { }
medium - = _ + ] { }
large - = _ + ] { }
larger - = + ] { }
small - = _ + ] { }
smaller - = + ] { }
x-large - = _ + ] { }
x-small - = _ + ] { }
xx-large - = _ + ] { }
xx-small - = _ + ] { }

font-style property - = _ + ] { }
italic - = _ + ] { }
normal - = _ + ] { }
oblique - = _ + { }

font-variant property - = _ + { }
normal - = _ + { }
small-caps - = _ + { }

CSS Quick Reference 597

font-weight property - = _ + ] { }
bold - = _ + ] { }
bolder - = _ + ] { }
lighter - = _ + { }
normal - = _ + ] { }

height property - = _ + { }
auto - = _ + { }

letter-spacing property - = _ + { }
normal - = _ + { }

line-height property - = _ + ] { }
normal - = _ + ] { }

list-style property - = _ + ] { }

list-style-image property - = _ + { }
none - = _ + { }

list-style-position property - = _ + { }
inside - = _ + { }
outside - = _ + { }

list-style-type property - = _ + ] { }

circle - = _ + ] { }
-=_+]{}
decimal
disc - = _ + ] { }
lower-alpha - = _ + ] { }
lower-roman - = _ + ] { }
none - = _ + ] { }
square - = _ + ] { }
upper-alpha - = _ + ] { }
upper-roman - = _ + ] { }

margin property - = _ + { }
auto - = _ + { }

598 Appendix B

margin-bottom property - = _ + { }
auto - = _ + { }

margin-left property - = _ + { }
auto _ + { }

margin-right property - = _ + { }
auto _ + { }

margin-top property - = _ + ] { }
auto - = _ + ] { }

padding property - = _ + { }

padding-bottom property - = _ + { }

padding-left property - = _ + { }

padding-right property - = _ + { }

padding-top property - = _ + { }

text-align property - = _ + ] { }
center - = _ + ] { }
left - = _ + ] { }
justify - = _ + { }
right - = _ + ] { }

text-decoration property - = _ + ] { }

blink ] { }
line-through - = _ + ] { }
none - = _ + ] { }
-=_+{}
overline
-=_+]{}
underline

CSS Quick Reference 599

text-indent property - = _ + ] { }

text-transform property - = _ + ] { }
capitalize - = _ + ] { }
lowercase - = _ + ] { }
none - = _ + ] { }
uppercase - = _ + ] { }

vertical-align property - = _ + { }

baseline -=_+{}

bottom _+{}

middle _+{}

sub - = _ + { }
super - = _ + { }
_ + { }text-bottom
_+{}
text-top
top _ + { }

white-space property _ + ] { }
normal _ + ] { }
nowrap _ + { }
pre ] { }

width property - = _ + ] { }
auto - = _ + ] { }

word-spacing property + {
+ {normal

Pseudo-classes and Pseudo-elements

active - = _ + { }
_ + { }first-line
_ + { }first-letter
link - = _ + ] { }
visited - = _ + { }



Index

Symbols & Numbers arguments font-size, 362–363
document.write method, font-style, 362–363
++ operator, 172–173 92–93 font-weight, 362–363
@ sign, e-mail address in functions as, 48 id, 328
introduction, 18 letter-spacing, 366–367
forms, 202 methods, 18 line-height, 328, 348–349
// (slashes) in comments, 10 order in introductory margin, 372–373
paragraph, 57 margin-bottom, 372–373
A passing to functions, 56–57 margin-left, 372–373
replace method, 34 margin-right, 372–373
absolute placement (CSS), window.alert method, 90 margin-top, 372–373
368–369 onMouseOver, 122–123,
Array object
absolute placement (HTML), creation, 40 454–455
layers, 522 length property, 130 padding, 404–405
length property, number of position, 350–351
action attribute, form buttons, entries and, 142 text-align, 364–365
multiple and, 220 methods, 560–561 text-decoration, 362–363
properties, 560–561 text-transform, 400–401
action property, form tag in value, 188, 190–191
form submission URL and, 226 arrays visibility, 526–527
containers, 40 word-spacing, 366–367
addresses creation, 40–41 z-index, 358–359, 520–521
e-mail, validation, 202–203 data types and, 134 auto cursor, 434
IP, checking with definition, 131 auto-scrolling, 450–451
bookmarklets, 502–503 document object and, 90
document.all, 498–499 B
Alert dialog boxes document.images, 492–493
introduction, 50–51 imageList, slide show background
recurring functions, 78 captions, 148 color, changing with
images, 118 bookmarklet, 486–487
alert dialog boxes indexes, 42 color,
window object, creating and, looping through, 74–75
238–239 numbering in, 130 object.style.background
window object and, 236 populating, 42–43
sorting, 44–45 and, 352–353
alignment color, setting with X library,
centering horizontally, arrows in cursor, 434
346–347 attributes 548–549
centering vertically, 344–345 images, removing with
text (CSS), 364–365 checked, 180, 190–191
cursor, 434–435 bookmarklet, 488–489
all-scroll cursor, 434 float, 382–383 images, setting with X library,
American Express card font-family, 360–361
550–551
numbers, 208
Anchor object, 559 background-attachment
animation
property, CSS, 593
banner generation, 156–157
GIF files, 156
Applet object, 559–560
Area object, 560

602 JavaScript in 10 Simple Steps or Less

background-color images, removing background, bottomTarget argument,
488–489 swapLayer function, 358–359
property, 593
installation, 474–475 browser windows
background-image IP addresses, checking, closing, 236, 270–271
closing from links, 272–273
property, 593 502–503 creating with window object,
last page modification, 244–245
background-position dependent, Netscape and,
476–477 274–275
property, 594 links, highlighting, 498–499 documents, loading, 258–259
background property, CSS, 593 links, opening all in new forms, access from another
window, 268–269
background-repeat window, 494–495 full screen, opening in
page freshness checks, Internet Explorer, 262–263
property, 594 left property, 250–251
backgroundColor property, 476–477 location setting, 250–251
Yahoo! searches in IE, opening, 236
links, highlighting with opening, window object and,
bookmarklets, 498–499 504–505 244
banners Yahoo! searches in Netscape, opening from link, 246–247
parent/child relationships,
animated, generating, 506–507 264–265
156–157 Bookmarks (Netscape), resizing, 256–257
screenX property, 250–251
hiding with bookmarklet, bookmarklets, 475 screenY property, 250–251
492–493 boolean data types, 24 scroll bar display, 254–255
boolean expressions, browser scrolling control, 260–261
random ad, 158–159 size, content size (Netscape),
big method, strings, 36 detection variables and, 276–277
blink method, strings, 36 516–517 size, detecting, 398–399
blocks Boolean object, 561 size, window object and, 236
border-bottom property, size control, window.open
new-line characters, 94 CSS, 594 method and, 248–249
script blocks, 2–3 size restrictions, 256–257
script blocks, multiple, 82–83 border-bottom-width toolbar visibility, 252–253
bmyArray.sort method, top property, 250–251
document.write method property, CSS, 594 updating content from
and, 44 border-color property, another window, 266–267
bold method, strings, 36
bold text, font-weight CSS, 594 browsers
attribute, 362–363 border-left property, browser document, replacing
bookmarklets with new, 110–111
background color, changing, CSS, 594 conditions testing for, 514
cookie storage, 317
486–487 border-left-width date output, 96–97
banners, hiding, 492–493 detection variables, building,
date and time check, 500–501 property, 594 516–517
downloading, 474–475 border property, CSS, 594 layer creation, div tag and,
e-mail links, checking for, border-right property, 520–521

478–479 CSS, 594
e-mail text in Internet border-right-width property,

Explorer, 480–481 CSS, 594
e-mail text in Netscape, border-style property,

482–483 CSS, 595
fonts, changing, 496–497 border-top property, CSS, 595
images, displaying all in a border-top-width property,

page, 484–485 CSS, 595
images, hiding, 490–491 border-width property,

CSS, 595
borderStyle property,

highlighting menu creation,
442–443

Index 603

noscript tag, 6–7 changeDropColor function, global style sheets, overriding,
object placement in new 352–353 380–381

browsers, 581–519 changeDropWidth function, classes, java.net, 502–503
type detection, 510–511 352–353 clear property, CSS, 595
type detection, object testing clearTimeout method,
changeList function, 174–175
and, 514–515 charAt method, zip code scheduled functions, 80–81
user agents, 514–515 click events
version detection, 512–513 validation, 204
version detection, object charCodeAt method, Unicode image detection, 124–125
responding to, 456–457
testing, 514 and, 230 close method, browser
window creation, window check boxes windows, 270–271
closing windows
object and, 244–245 checked attribute, 190–191 browser windows, 270–271
writing output to, 18–19 creation, 188–189 browser windows, from links,
Button object, 561 input tag, 188
buttons onClick event handler, 272–273
forms, mouse click reactions, floating windows, 422–423
190–191 code. See also source code
222–223 selection changes, detecting, executing, page loads and,
graphical, 224–225
multiple with INPUT 194–195 64–65, 84–85
selection status, 190–191 executing, user leaves page
TYPE=”button,” 220–221 selection validation, 214–215
object movement control and, selections, status control, and, 468–469
external, 8–9
340–341 192–193 hidden frames, 288–289
radio, creating groups, 180 value attribute, 188, 190–191 hiding, 4–5
Checkbox object, 562 loading after page load,
C checkCheckbox function,
214–215 onLoad event handler and,
calendar, outputting, 104–105 checkCreditCard function, 208 466–467
calling functions checked attribute main, storage in one frame,
check boxes, 190–191 286–287
description, 48–49 radio buttons, 180 sharing between frames,
from tags, 62–63 checked property, radio buttons, 282–283
canceling scheduled functions, 182, 186–187 storing, 8–9
80–81 checkEmail function, address storing, menu code in external
capitalization validation and, 202–203 files, 416–417
drop caps, 382–383 checkField function, form field col-resize cursor, 434
forcing with style sheet verification, 196–197 collapsing/expanding menus,
checkList function, 210–211 creating, 438–439
settings, 400–401 checkNumber function, numeric color
captions, slide shows, 148–149 text field validation, 228–229 background, changing with
CBE library, 540 checkPassword function, bookmarklets, 486–487
centerHorzontally function, 216–217 background,
checkPhone function, 206
346–347 checkRadio function, 212–213 object.style.backgroun
centering checkZip function, 204
class definitions d, 352–353
horizontal, 346–347 document style sheets, 376 background, setting with X
text (CSS), 364–365 global style sheets, 378–379
vertical, 344–345 library, 548–549
centerVertically function,
344–345
Central European Time, 98–99

604 JavaScript in 10 Simple Steps or Less

color (continued) containers createMenu function, external
depth of user’s display, arrays, 40 files, storing in, 416–417
402–403 variables, 22–23
text, changing with X library, createRange method
546–547 content bookmarklets, 480–481
browser window size Yahoo! searches with
color property, CSS, 595 (Netscape), 276–277 bookmarklets, 504–505
commands browser windows, updating
from another window, createRollOver function,
compound, curly brackets and 266–267 136–137
(), 16–17 floating windows, changing,
428–429 credit card number validation in
deletion from scripts, 14–15 offscreen placement, 444–445 forms, 208–209
introduction, 12–13 offscreen placement, sliding
comments into view, 446–447 cross-browser libraries
// slashes in, 10 selection lists, dynamically (DHTML), 540–541
HTML, hiding JavaScript changing, 174–175
text fields, accessing, 164–165 crosshair cursor, 434
code, 4–5 CSS (Cascading Style Sheets)
multiline, 10–11 cookies
single-line, 10–11 accessing, 304–305 absolute placement, 368–369
compatibility creating, 302–303
browser type detection, deleteCookie function, 322 background-attachment
deleting, 314–315
510–511 directories, 324–325 property, 593
browser type detection, object displaying, 306–307
displaying in all pages on site, background-color
testing and, 514–515 324–325
browser version detection, escape function, 302, property, 593
316–317
512–513 expiration, 308–309 background-image
complete property, Image function library, creating,
322–323 property, 593
object, 150 getCookie function, 322
compound commands, curly loginName, username background-position
display and, 306–307
brackets (), 16–17 multiple, accessing, 318–319 property, 594
concatenation multiple, creating, 316–317 background properties, 593
new visitor home page,
dynamic HTML and, 92–93 320–321 background-repeat
of strings, 30–31 page access counts, 312–313
condition-based loops, 67 security, 304–305 property, 594
condition controlling loops, 66 setCookie function, 322 border-bottom property,
conditional branching looping, split method and, 304
68–69 users, tracking sessions, 594
conditional loops, 72–73 310–311
conditions, short-form of testing, border-bottom-width
70–71 corners, drop shadows in
confirm method nonstandard, 356–357 property, 594
condition testing, loops, border-color property, 594
counters, personal, cookies, border-left property, 594
70–71 312–313
confirmation dialog boxes, border-left-width

240–241 property, 594
introduction, 52–53 border properties, 594
confirmation dialog boxes border-right property, 594
introduction, 52–53
window object and, 236, border-right-width

240–241 property, 594
border-style property, 595
border-top property, 595

border-top-width

property, 595
border-width property, 595
capitalization, forcing,

400–401
clear property, 595
color property, 595

Index 605

cursor styles, changing, list-style-type col-resize, 434
434–435 crosshair, 434
property, 597 default, 434
display property, 595–596 margin-bottom property, 598 hand, 434
document style sheets, margin-left property, 598 help, 434
margin property, 597 I-bar, 434
376–377 margin-right property, 598 move, 434
drop cap creation, 382–383 margin-top property, 598 no-drop, 434
drop shadows, creating, margins, 372–373 not-allowed, 434
padding, 404–405 pointer, 434
350–351 progress, 434
drop shadows, modifying, padding-bottom row-resize, 434
style changes, 434–435
352–353 property, 598 text, 434
drop shadows, removing, padding-left property, 598 vertical-text, 434
padding property, 598 wait, 434
354–355 padding-right property, 598
drop shadows in nonstandard padding-top property, 598 D
pseudo-classes, 599
corners, 356–357 pseudo-elements, 599 data types
first line of all elements on quick reference icons for array elements, 134
boolean, 24
page, 386–387 properties, 593 numeric, 24, 26–27
first line of text appearance, relative placement, 370–371 string, 24
settings, accessing, 390–391
384–385 settings, editing, 392–393 date and time
float property, 596 spacing, 366–367 Central European Time,
font-family property, 596 style sheet files, global, 98–99
font property, 596 checking with bookmarklets,
font-size property, 596 378–379 500–501
font style, 362–363 text-align property, 598 getDate method, 100
font-style property, 596 text alignment, 364–365 getDay method, 100
font-variant property, 596 getFullYear method, 100
font-weight property, 597 text-decoration getHours method, 100
fonts, 360–361 getMinutes method, 100
global style sheets, files, property, 598 getMonth method, 100
text-indent property, 599
378–379 getTimezoneOffset
global style sheets, overriding text-transform
method, 98–99
for local instances, 380–381 property, 599 output customization,
height property, 597
highlighting menu creation, vertical-align 102–103
output to browser, 96–97
440–441, 442–443 property, 599 output to browser, formatting,
inline styles, 374–375 white-space property, 599
width property, 599 100–101
letter-spacing word-spacing property, 599 setHours method, 98–99
cssRule object, 562 time zone and, 98–99
property, 597 curly brackets () in compound toGMTString method, 100
line height, 348–349 commands, 16–17
line-height property, 597 cursor toLocaleString
line spacing, 328–329 hourglass, 434
links, special styles for, scrolling, 434 method, 100
cursor attribute (CSS), 434–435 toUTCString method, 100
388–389 cursors
all-scroll, 434
list-style-image auto, 434

property, 597

list-style-position

property, 597
list-style property, 597

606 JavaScript in 10 Simple Steps or Less

date method, outputting date to alert, window object and, document.body.clientWidth
browser, 96–97 238–239
property, browser window size,
Date object confirmation, 52–53 398–399
calendar output, 104–105 confirmation, window object
looping and, 104–105 document.body.scrollTop
methods, 100, 562–564 and, 240–241
properties, 562 window.alert method, 50 property
tostring method, 96 directories, cookies, 324–325 auto-scrolling, 450–451
display property, CSS, 595–596 browser window scrolling,
dates, month numbering and, 309 div tag 260–261
Debug object, 562 drop shadows and, 350–351
debugging, 14 layer creation and, 520–521 document.cookie object
declaring variables, 20–21 line height and, 329 cookie access, 304–305
default cursor, 434 div tag (inner) deleting cookies, 314–315
deleteCookie function, 322 drop shadows in nonstandard displaying cookies, 306–307
delimiters, splitting at strings, expiration date of cookies,
corners, 356–357 308–309
46–47 left attribute, 356–357 introduction, 302
dependent browser windows, top attribute, 356–357 multiple cookies, 316–317
doAlert function, 290–291 multiple cookies, accessing,
Netscape and, 274–275 document object 318–319
DHTML (Dynamic HTML) access, 90–91 page access counting, 312–313
arrays, 90 strings, 304
absolute placement (CSS), methods, 90, 565–566 tracking user sessions,
368–369 properties, 90, 564–565 310–311
document style sheets. See also
cross-browser libraries, CSS (Cascading Style Sheets) document.createComment
540–541 class definitions, 376
HTML element object, browser version
drop shadows (CSS), 350–351 detection, 514
drop shadows (CSS), definitions, 376 document.fireEvent object,
identity definitions, 376 browser version detection, 514
modifying, 352–353 document.all array, links, document.forms array, naming
drop shadows (CSS), highlighting with bookmarklets, forms and, 164
498–499
removing, 354–355 document.all object, browser document.getElementById
first line of text appearance version detection, 514
document.body object, page method, object referencing, 328
(CSS), 384–385 fonts, changing with
fonts (CSS), 360–361 bookmarklet, 496–497 document.getElementById
line height, 348–349
margins (CSS), 372–373 document.body.background object, browser version
padding (CSS), 404–405 detection, 514
relative placement (CSS), property
background image removal document.getSelection
370–371 with bookmarklet, 488–489
spacing (CSS), 366–367 bookmarklet for changing method, bookmarklets, 482–483
style sheet setting access, color, 486–487 document.images array

390–391 document.body.clientHeight banners, hiding with
style sheet setting bookmarklet, 492–493
property
modifications, 392–393 browser window size, 398–399 bookmarklet displaying
text alignment (CSS), 364–365 introduction, 344–345 images, 484–485
DHTML Library, 540
diagonal movement of objects, document.lastModified
338–339
dialog boxes property, bookmarklets and,
Alert, 50–51 476–477
document.layers object,
browser version detection, 514

Index 607

document.links array drop-down menus encapsulation, functions, 54–55
e-mail link checking with generating using a function, encrypt function, form
bookmarklets, 478–479 414–415
links, opening all in new prebuilt, inserting, 418–419 submission and, 230
window with bookmarklet, encryption, forms submission
494–495 drop shadows (CSS)
mailto: protocol and, 478 creating, 350–351 and, 230–231
inner div tag, 356–357 end-of-line-type characters,
document.location property modifying, 352–353
loaded document URL, 258 nonstandard corners, 356–357 document.write method, 18
loading documents into removing, 354–355 Enumerator object, 566
browser window, 258–259 Error object, 566
dropObject variable, 354–355 escape function, cookies, 302,
document.myImage, 118 dynamic changes, selection list
document.open method, 316–317
content, 174–175 escapes, URL parameter
browser document replacement, dynamic HTML, outputting,
110–111 values, 107
document.write method 92–93 evaluation of operators, 28
dynamic output event handlers
arguments, 92–93
calendar generation and, calendar generation, 108–109 definition, 454
document object and, 90–91 form fields, this keyword
104–105 dynamic updates, text fields,
date output, 96 166–167 and, 176–177
myArray.sort method dynamically creating frames, image buttons, 224
294–295 onBlur, form field losing
and, 44 dynamically updating frame
new-line characters, 94 content, 296–297 focus and, 460–461
output, 18–19 dynamicdrive.com, 418 onBlur, form field
separators in output, 46 DynAPI library, 540
string formatting, 36–37 verification and, 196–197
document.writeln method E onChange, selection list
date output, 96
document.write and, 95 e-mail selections and, 470–471
introduction, 18 address validation, 202–203 onClick, check boxes and,
doMouseOver function, 454–455 links, checking for with
doSquare function, text field bookmarklets, 478–479 190–191
change responses, 458–459 sending text with onClick, function calls and,
drag-and-drop bookmarklets in IE, 480–481
detecting events, 430–431 sending text with 62–63
moving dragged objects, bookmarklets in Netscape, onClick, redirection and,
482–483
432–433 112
onDrag event, 430–431 elements of arrays onFocus, form field gaining
onDragEnd event, 430–431 data types, 134
onDragEnter event, 430–431 population and, 43 focus, 460–461
onDragLeave event, 430–431 onLoad, 466–467
onDragOver event, 430–431 embedded functions, as onLoad, calling code and,
onDragStart event, 430–431 arguments, 48
onDrop event, 430–431 64–65
drop caps, CSS, 382–383 embedded images, accessing, onUnload, 84, 468–469
drop-down lists, navigation and, 118–119 responding to user clicks,
232–233
empty fields, e-mail address in 456–457
forms, 202 event object, 567–568
events
enabling, JavaScript, 86–87
click events, detecting,
124–125

drag-and-drop, detecting,
430–431

onMouseOut, 128

608 JavaScript in 10 Simple Steps or Less

events (continued) floater.close, 422–423 sans-serif, 360
onMouseOver, 152–153 floater.moveBy, 426–427 serif, 360
onMouseOver, detecting, floater.resizeTo, 424–425 size, 362–363
122–123 floating windows style (CSS), 362–363
fontsize method, strings, 36
event.srcElement, 432–433 closing, 422–423 for loops
expanding/collapsing menus, content changes, 428–429 document.images array,
creating, 420–421
creating, 438–439 moving, 426–427 bookmarklets and, 484–485
expiration, cookies, 308–309 resizing, 424–425 images, hiding with
expressions floatingWindow function
changing floating window bookmarklet, 490–491
concatenation, 31 offscreen content, moving,
introduction, 29 content, 428–429
regular expressions (See closing floating windows, 446–447
for statement, 66–67
regular expressions) 422–423 for statement, for loops, 66–67
external files, menu code storage, introduction, 420–421 form fields. See also fields
moving floating windows, choosing which to use, 180
416–417 focus, onBlur event
426–427
F resizing floating windows, handler and, 462–463
focus, onFocus event handler
fading objects, 536–537 424–425
Favorites (Internet Explorer), focus and, 460–461
verification, 196–197
bookmarklets, 474 form fields, onBlur event verification, INPUT
fields. See also form fields handler and, 462–463
TYPE=”button,” 200–201
choosing which to use, 180 form fields, onFocus event verification, onBlur event
focus method, 196 handler and, 460–461
naming, 163 handler, 196–197
text, accessing content, focus method, form field verification, onSubmit
verification, 196
164–165 attribute, 198–199
text, detecting changes in, font-family attribute, 360–361 Form object, 568
font-family property, CSS, Form tag, onSubmit attribute,
168–169
text, dynamic updates, 596 form field verification, 198–199
font property, CSS, 596 form tag, name attribute and,
166–167 font-size attribute, 362–363
text, responding to changes in, font-size property, CSS, 596 163
font-style attribute, 362–363 format
458–459 font-style property, CSS, 596
this keyword and, 176–177 font-variant property, date output, 100–101
verifying, 196–197 strings, 36–37
verifying, onBlur event CSS, 596 strings, multiple functions,
font-weight attribute, 362–363
handler, 196–197 font-weight property, CSS, 38–39
files, style sheets, global, 378–379 forms
FileUpload Object, 568 597
fontcolor method, strings, 36 access, from another browser
filters.alpha.opacity fontFamily property, page window, 268–269

property, 536–537 fonts, changing with buttons, mouse click reactions,
first-line selector, 384–385, bookmarklet, 496–497 222–223
fonts
386–387 buttons, multiple with INPUT
firstList function, 178–179 changing with bookmarklet, TYPE=”button,” 220–221
fixed method, strings, 36 496–497
float attribute, drop caps and, check box creation, 188–189
CSS, 360–361 check box selection status,
382–383
float property, CSS, 596 190–191

Index 609

check box selection validation, selection lists, 176–177 function library, cookies,
214–215 (See also selection lists) creating, 322–323

checked attribute in radio selection lists, navigation and, Function object, 569
buttons, 180 232–233 functions

credit card number validation, submission URL, controlling, as arguments, 48
208–209 226–227 arguments, passing to

e-mail address, @ missing, 202 zip code validation, 204–205 functions, 56–57
e-mail address, dot forms array, form order, 162 calling, 48–49
Frame object, 569 calling from tags, 62–63
missing, 202 frame tag
e-mail address, empty centerHorzontally,
frame updates, 280–281
field, 202 name attribute, 278 346–347
e-mail address, illegal frames
bookmarklet for background centerVertically,
characters, 202
e-mail address validation, color, 486–487 344–345
code sharing, 282–283 changeDropColor, 352–353
202–203 content, dynamic updates, changeDropWidth, 352–353
encryption and, 230–231 changeList, 174–175
graphical buttons, 224–225 296–297 checkCheckbox, 214–215
image element, 224–225 cross-reference, nesting and, checkCreditCard, 208
input tag and radio checkList, 210–211
290–291 checkPassword, 216–217
buttons, 180 dynamic creation, 294–295 checkPhone, 206
name attribute, 163 hidden, 288–289 checkRadio, 212–213
naming, 163 loading pages to, 278–279 checkZip, 204
naming, document.forms main code storage, 286–287 createRollOver, 136–137
naming, 278 creation, 54–55
array and, 164 nested, 290–291 deleteCookie, 322
navigation and, 232–233 nested, cross-referencing and, doAlert, 290–291
password validation, 216–217 doMouseOver, 454–455
phone number validation, 290–291 doSquare, 458–459
pseudo-persistent data and, drop-down menu generation,
206–207
phone number validation, 284–285 414–415
unnamed, referencing encapsulation, 54–55
regular expressions and, encrypt, 230
218–219 numerically, 298–299 escape, 302, 316–317
post-processing data, updating, multiple from firstList, 178–179
floatingWindow, 420–421
onSubmit event another link, 292–293 getCookie, 322
updating from another frame, hideLayer, 444–445,
handler and, 464–465
preparation for JavaScript, 280–281 448–449, 532–533
variables and, 284 hideObject, 394–395
162–163 FrameSet object, 569 lineHeight, 328
radio button groups, frameset tag menuToggle, 408–409,
frame updates, 280–281
accessing, 182 rows attribute, 278 410–411
radio button groups, fullScreen property, browser methods comparison, 48
windows in Internet Explorer, moreSpace, 328
creating, 180 262–263 moveDiagonally, 338–339
radio button selection function keyword, cookie moveDown, 336–337
function creation, 322
validation, 212–213
radio button selections,

182–183
selection list choice validation,

210–211

610 JavaScript in 10 Simple Steps or Less

functions (continued) xHide, 542–543 height property
moveLayer, 530–531 xMoveTo, 552–553 browser windows, 248–249
moveObject, 342–343 xResizeTo, 556–557 CSS, 597
moveRight, 334–335 xShow, 542–543 style attribute, 344–345
moveUp, 340–341 xSlideTo, 554–555
xZIndex, 544–545 help cursor, 434
newFloatingWindow, hidden frames, 288–289
G Hidden object, 570
428–429 hideLayer function
nextSlide, 146 getCookie function
parameters, passing multiple cookieName argument, 322 layer visibility, 532–533
function keyword, 322 offscreen content and,
to functions, 60–61 function library and, 322
parseInt, 328, 340–341 values returned, 322 444–445
previousSlide, 146 sliding menus, 448–449
processForm, 464–465 getDate method, 100 hideObject function, 394–395
removeDrop, 354–355 getDay method, 100 hiding
getFullYear method, 100 banners, bookmarklets and,
resizeFloatingWindow, getHours method, 100
getLocalHost method, IP 492–493
424–425 code, 4–5
resizeLayer, 530–531 address checking with elements, X library, 542–543
rollover creation, 134–135 bookmarklet, 502–503 images, with bookmarklets,
rollovers, multiple on one getMinutes method, 100
getMonth method, 100 490–491
page, 138–139 getTimezoneOffset method, layers, 532–533
rollovers, triggering, 136–137 outputting date/time and, layers, HTML and, 526–527
scheduling, 76–77 98–99 objects, 394–395
scheduling, canceling, 80–81 GIF files highlighting links, bookmarklets
scheduling, recurring, 78–79 and, 498–499
scheduling, window object animation and, 156 highlighting menus, creating,
buttons, 224 440–441, 442–443
and, 236 Glimmer library, 540 History object, 570–571
scrollCheck, 436–437 Global object, 570 hit counter, personal, cookies
scrollDocument, 260 global style sheets and, 312–313
scrollPage, 450–451 files, 378–379 home pages, new visitors, cookies
secondList, 178–179 overriding for local instances, and, 320–321
selectButton, 186–187 horizontal centering, 346–347
setCookie, 322 380–381 horizontal movement of objects,
setOpacity, 536–537 GMT (Greenwich Mean Time), 334–335
showLayer, 448–449, hourglass cursor, 434
98–99 HTML element definitions
532–533 graphical buttons in forms, document style sheets, 376
showObject, 396–397 global style sheets, 378–379
slideShow, 142 introduction, 224–225 global style sheets, overriding,
swapLayer, 358–359, Greenwhich Mean Time, 98–99
groups 380–381
534–535 HTML (HyperText Markup
toggleMenu, 438, 443 radio buttons, access, 182
unescape, 304 radio buttons, creating, 180 Language)
values, function calls and, 48 comments, hiding JavaScript
values, returning, 58–59 H code, 4–5
void, 484–485 dynamic HTML, outputting,
XBackground, 550–551 hand cursor, 434 92–93
xColor, 546–547, 548–549 height attribute, layers, HTML

and, 524–525

Index 611

files, global style sheets in, images INPUT TYPE=”button”
378–379 background, removing with form buttons, multiple and,
bookmarklet, 488–489 220–221
JavaScripting, hiding background, setting with X form field verification and,
code, 4–5 library, 550–551 200–201
bookmarklets and, displaying
layer placement, 522–523 all images in a page, 484–485 Internet Explorer
layer placement, absolute, 522 click events, detecting, bookmarklets, 474
layer placement, relative, 522 124–125 e-mailing text using
layer visibility, 526–527 embedded, accessing, 118–119 bookmarklets, 480–481
layers, ordering, 528–529 hiding with bookmarklets, full screen browser window,
layers, size, 524–525 490–491 opening, 262–263
loading, 120–121 page transitions, 538–539
I loading, testing if loaded, Yahoo! searches with
150–151 bookmarklets, 504–505
I-bar cursor, 434 onClick attribute, 124–125
icons, quick reference, onMouseOut events, 128 IP addresses, checking with
onMouseOver events, bookmarklet, 502–503
browsers, 559 454–455
id attribute, assigning ID, 328 onMouseOver events, italic text, font-style attribute,
identity definitions detecting, 122–123 362–363
random, 130–131
document style sheets, 376 random, loading multiple, italics method, strings, 36
global style sheets, 378–379 132–133
global style sheets, overriding, random, script blocks, 132 J
rollovers, switching images
380–381 programmatically, 126–127 Java, enabled,
if statement size, 118–119
navigator.javaEnabled
introduction, 68–69 images array, entries, 118 method, 502–503
window.confirm method, <img> tag, referencing images, javaEnabled method, 86–87
java.net class, IP address
240 118 checking with bookmarklet,
Iframe object, 571 index-based loops, 67 502–503
illegal characters, e-mail address index variable, loops, 74–75
indexes java.net.InetAddress
in forms, 202
image buttons arrays, 42 .getLocalHost( )
for loops, 66
event handlers, 224 Z indexes, 358–359 .getHostAddress( )
as submit buttons, 224 indexOf method, characters in method, 502–503
image element, forms, graphical cookies, 318 JavaScript, enabled, checking for,
buttons and, 224 inline styles (CSS), 374–375 86–87
image maps, rollovers and, innerHTML property, 432–433 JPEG files
154–155 input fields, detecting changes,
Image object 168–169 banners, 156
complete property, 150 input tag buttons, 224
images array, 118 check boxes and, 188 .js files, 9
introduction, 571 radio button creation, 180
loading images and, 120–121 text fields, 168–169 L
imageList array
animated banners, 156 Layer object, 572–573
slide show captions, 148 layerRef method, 328
imageList variable, layers
bookmarklets, 484–485
creating, div tag and,
520–521

drop shadows and, 352–353

612 JavaScript in 10 Simple Steps or Less

layers (continued) line height images, multiple random,
height attribute, 524–525 CSS, 348–349 132–133
margins, 373 div tag and, 329
ordering, 534–535 parseInt function and, 328 images, random, 130–131
ordering, HTML, 528–529 images, testing if loaded,
ordering, X library and, line-height attribute
544–545 CSS line height, 348–349 150–151
placement, changing, 530–531 introduction and, 328 pages to frames, 278–279
placement control, HTML loading pages
and, 522–523 line-height property, CSS, calling code after, 64–65,
size, HTML and, 524–525 597
size, X library and, 556–557 84–85
visibility, 532–533 line spacing, CSS and, 328–329 placeholder, 114–115
visibility, HTML and, lineHeight function, 328 locating objects, 330–331
526–527 Link object, 573 Location object, 573–574
width attribute, 524–525 link style, 388–389 location property, window
x.js script library file, links object, 112
542–543 loginName cookie, username,
browser windows, closing, 306–307
left attribute 272–273 loops
div tag, 356–357 arrays, looping through,
layer placement, HTML e-mail, checking for with
and, 522 bookmarklets, 478–479 74–75
object location, 330–331 condition-based loops, 67
object placement and, highlighting, bookmarklets condition controlling, 66
332–333 and, 498–499 conditional, 72–73
conditional branching
left property, browser windows, opening all in new window
250–251 with bookmarklet, 494–495 looping, 68–69
Date object and, 104–105
leftPosition variable, sliding opening browser windows, index-based, 67
menus, 448–449 246–247 index variable, 74–75
for loops, for statement,
length property rollovers, triggering in
Array object, 130 different location with, 66–67
Array object, number of 152–153 for loops, viewing offscreen
entries, 142
e-mail address validation, slide show transitions, content, 446–447
202–203 triggering, 146–147 short-form condition testing,
radio buttons, 182
selection list content changes, styles (CSS), 388–389 70–71
174–175 text input elements, 164 while command, 72–73
selection lists, 172–173 updating frames from, lowercase, changing all to,
400–401
letter-spacing attribute, 292–293
366–367 list-style-image property, M

letter-spacing property, CSS, 597 mailto: protocol, link checking
CSS, 597 with bookmarklets and, 479
list-style-position
libraries map blocks, 154
cross-browser (DHTML), property, CSS, 597 margin attribute, 372–373
540–541 list-style property, CSS, 597 margin-bottom attribute,
function library for cookies, list-style-type property,
322–323 372–373
CSS, 597 margin-bottom property,
lists
CSS, 598
option lists, 180 margin-left attribute, 372–373
selection list, populating

programmatically, 172–173
selection list access, 170–171
loading
code after page load, onLoad

event handler and, 466–467
images, 120–121

Index 613

margin-left property, CSS, 598 menuToggle function getLocalHost, 502–503
margin property, CSS, 597 drop-down menu generation, getMinutes, 100
margin-right attribute, 414–415 getMonth, 100
pull-down menu creation,
372–373 408–409, 410–411 getTimezoneOffset,
margin-right property, pull-down menu selections, 98–99
412–413
CSS, 598 Global object, 570
margin-top attribute, 372–373 meta tags, page transitions, History object, 570–571
margin-top property, CSS, 598 Internet Explorer, 538–539 Image object, 571
margins italics, 36
methods javaEnabled, 86–87
CSS, 372–373 Applet object, 559–560
padding and, 404–405 Area object, 560 java.net.InetAddress.
Mastercard numbers, 208 arguments, 18
Math object Array object, 560–561 getLocalHost( ).
array numbering, 130 big, 36
methods, 574 blink, 36 getHostAddress( ),
properties, 574 bold, 36 502–503
random banner ads, 158 Boolean object, 561 Layer object, 572–573
mathematical operations, 28–29 Button object, 562 layerRef, 328
Math.floor, 130 charCodeAt, 230 Location object, 574
menu class, pull-down menu Checkbox object, 562 Math object, 574
creation and, 409 clearTimeout, 80–81 moveBy, 426–427
menuLink class, pull-down menu close, 270–271 navigator object, 575–576
creation, 409 confirm, 52–53, 240–241 Number object, 576
menus date, 96–97 Object object, 576
code storage in external files, Date object, 562–564 open, 244–245
Debug object, 562 Option object, 577
416–417 document object, 565–566 Password object, 577
drop-down, generating using a document object and, 90 Plugin object, 577
document.write, 18–19, quick reference, 559
function, 414–415 36–37 Radio object, 578
drop-down, inserting prebuilt, document.writeln, 18, 95 Range object, 578–579
Error object, 566 RegExp object, 579
418–419 event object, 568
expanding/collapsing, FileUpload object, 568 Regular Expression
fixed, 36 object, 579
creating, 438–439 focus, 196
generating dynamically, fontcolor, 36 replace, 34
fontsize, 36 Reset object, 580
108–109 Form object, 568 resizeTo, 424–425
highlighting menus, creating, Function object, 569 Select object, 581
functions comparison, 48 setHours, 98–99
440–441, 442–443 getDate, 100 setTimeout, 76–77, 142
pull-down, creating, 408–409 getDay, 100 sizeToContent, 276–277
pull-down, creating multiple, getFullYear, 100 small, 36
getHours, 100 sort, 44
410–411 split, 46
pull-down, selections, strike, 36
String object, 581–582
412–413 styleSheet object, 587–588
rollover menu system, sub, 36
Submit object, 588
140–141
sliding, creating, 448–449
menuTitle class, pull-down
menu creation, 409

614 JavaScript in 10 Simple Steps or Less

methods (continued) naming noscript tag, 6–7
sup, 36 frames, 278 not-allowed cursor, 434
test, 218 input tags for radio button Number object, 576
Text object, 588 groups, 180 number of colors in user’s display,
Textarea object, 589 variables, 20–21
toGMTString, 100, 308–309 402–403
toLocaleString, 100, navigation, forms and, 232–233 numeric data types, 24, 26–27
500–501 navigator object numeric text fields, validation,
toLowerCase, 36
toUpperCase, 36 browser type detection, regular expressions and,
toUTCString, 100 510–511 228–229
window object, 236, 590–592 numeric variables, creation,
window.alert, 50 methods, 575–576 26–27
window.confirm, 240–241 properties, 575
window.open, 244–245 O
window.setTimeout, 142 navigator.appCodeName:
Object object, 576
MimeType object, 575 property, browser type object placement, style
moreSpace function, 328 detection, 510–511
mouse, click reactions, forms, navigator.appName: property, property and, 332–333
browser type detection, object testing, browser detection
222–223 510–511
move cursor, 434 and, 514–515
moveBy method, 426–427 navigator.appVersion objects
moveDiagonally function,
property, browser version Anchor object, 559
338–339 detection, 512–513 Applet object, 559–560
moveDown function, object Area object, 560
navigator.javaEnabled Array object, 560–561
movement and, 336–337, Boolean object, 561
340–341 method, 86–87 Button object, 561
moveLayer function centering horizontally,
navigator.userAgent:
layer placement, 530–531 346–347
offscreen content, 446–447 property, browser type centering vertically, 344–345
moveLeft function, object detection, 510–511 Checkbox object, 562
movement and, 340–341 nested frames, 290–291 clicks on, responding to,
moveObject function, three- Netscape
dimensional movement and, 456–457
342–343 bookmarklets, 475 cssRule object, 562
moveRight function, object browser windows, sizing to Date object, 562–564
movement and, 334–335, Debug object, 562
340–341 contents size, 276–277 diagonal movement, 338–339
moveUp function, object dependent browser windows, document object, 564–566
movement and, 340–341 document object, access,
Mozilla versions, 512–513 274–275
multiline comments, 10–11 e-mailing text using 90–91
document.cookie, 304
N bookmarklets, 482–483 Enumerator object, 566
Yahoo! searches with Error object, 566
name attribute event object, 567–568
forms and, 163 bookmarklets, 506–507 fading, 536–537
frame tag, 278 new-line characters, output, FileUpload object, 568
Form object, 568
94–95 Frame object, 569
newCookie string, FrameSet object, 569

document.cookie object, 304
newFloatingWindow function,

moving floating windows and,
428–429
newScroll variable, auto-
scrolling, 450–451
nextSlide function, 146
no-drop cursor, 434

Index 615

Global object, 570 object.style.background, onDragStart event, drag-and-
Hidden object, 570 drop and, 430–431
hiding, 394–395 background color and, 352–353
History object, 571 onDrop event, drag-and-drop
horizontal movement, object.style.zindex, and, 430–431

334–335 358–359 onFocus event handler, form
Iframe object, 571 offscreen placement of content fields with focus, 460–461
Image object, 571
Layer object, 572–573 creating, 444–445 onLoad event handler
layer references, 328 sliding into view, 446–447 calling code and, 64–65
Link object, 573 onBlur event handler loading code after page loads
location determination, form field verification and, and, 466–467

330–331 196–197 onMouseOut event handlers,
Location object, 573–574 form fields losing focus, highlighting menu creation, 443
Math object, 574
MimeType object, 575 462–463 onMouseOut events, 128
movement control using onChange event handler onMouseOver event handlers,

buttons, 340–341 input fields, 168–169 highlighting menu creation, 443
navigator object, 575–576 selection list actions, 470–471 onMouseOver events
Number object, 576 selection list status, 176–177
Object object, 576 text field change responses, description, 454
Option object, 576–577 detecting, 122–123
Password object, 577 458–459 introduction, 152–153
placement in new browsers, onClick attribute, images, rollovers and, 122–127
onSubmit attribute, form field
581–519 124–125 verification, Form tag, 198–199
Plugin, 577 onClick event handler onSubmit event handler, post-
Radio object, 577–579 processing form data and,
Range object, 578–579 check box selection changes, 464–465
RegExp object, 579 194–195 onUnload event handler
calling code, 84
Regular Expression check boxes, 190–191 user leaves page for another
function calls and, 62–63
object, 579 images, 124–125 page, 468–469
Reset object, 580 mouse click, reactions to, opacity of objects, 536–537
screen Object, 580 open method, browser window
Script object, 580–581 222–223
Select object, 581 radio button selection creation, 244–245
showing, 396–397 opening browser windows
String object, 581–582 changes, 184
Style object, 582–587 redirection and, 112 full screen, Internet Explorer,
styleSheet object, 587–588 responses, 456–457 262–263
Submit object, 588 selection list content changes,
Text object, 588 from link, 246–247
Textarea, 588–589 174–175 window object and, 244
vertical movement, 336–337 text fields and, 164 operations
window, 236–237 onDrag event, drag-and-drop expressions, 29
window object, 589–592 and, 430–431 mathematical, 28–29
onDragEnd event, drag-and- operators
drop and, 430–431 ++, 172–173
onDragEnter event, drag-and- evaluation order, 28
drop and, 430–431 order of precedence, 28
onDragLeave event, drag-and- option lists, 180
drop and, 430–431 Option object, 576–577
onDragOver event, drag-and-
drop and, 430–431

616 JavaScript in 10 Simple Steps or Less

option tag padding-top property, placeholders, page loading,
selection list population, 404–405, 598 114–115
172–173
selection lists, 170–171 pages placement
accessing, counting with absolute (CSS), 368–369
options array, selection list cookies, 312–313 layers, changing, 530–531
populating and, 172–173 auto-scrolling, 450–451 layers, HTML and, 522–523
displaying cookies on all, object, new browsers and,
options property, selections list, 324–325 581–519
172–173 fonts, changing with offscreen content, 444–445
bookmarklet, 496–497 offscreen content, sliding into
order of precedence, images, displaying all with view, 446–447
operators, 28 bookmarklets, 484–485 X library and, 552–553
last modification,
ordering layers bookmarklets, 476–477 Plugin object, 577
HTML, 528–529 loading, calling code after, PNG files, buttons, 224
JavaScript, 534–535 64–65, 84–85 pointer, onMouseOver events,
X library and, 544–545 loading, placeholders and,
114–115 122–123
origScroll variable, auto- loading to frames, 278–279 pointer cursor, 434
scrolling, 450–451 redirection, 112–113 populating arrays, 42–43
transitions, Internet Explorer, populating lists, selection,
outerHTML property, 432–433 538–539
output populating programmatically,
parameters 172–173
browsers, writing, 18–19 functions, passing multiple position attribute
customizing URL variables, parameters to, 60–61
values, URLs, 107 drop shadows and, 350–351
106–107 layer placement, HTML
date, 96–97 parentheses, functions as
date, formatting, 100–101 arguments and, 48 and, 522
date and time, time zone and, position:absolute, 368–369
parseInt function position:relative, 370–371
98–99 line height and, 328 post-processing data, onSubmit
document.write method, object movement, 340–341
three-dimensional event handler and, 464–465
18–19 movement, 342 prebuilt drop-down menus,
dynamic, document object
passing parameters, to functions, inserting, 418–419
and, 90–91 multiple, 60–61 previousSlide function, 146
dynamic HTML, 92–93 processForm function, post-
new-line characters, 94–95 Password object, 577
separators in document.write passwords, validating in forms, processing form data and,
464–465
method, 46 216–217 progress cursor, 434
time of day customization, pathnames, cookies, 324–325 prompt method, window object
and, 242–243
102–103 persistentVariable prompts, window object and,
variables, 22–23 242–243
variable, 284 properties
P personal hit counter, cookies,
Anchor object, 559
padding, CSS and, 404–405 312–313 Applet object, 559–560
padding attribute, 404–405 phone numbers Area object, 560
padding-bottom property, Array object, 560–561
validation in forms, 206–207
404–405, 598 validation in forms, with background-attachment
padding-left property,
regular expressions, 218–219 (CSS), 593
404–405, 598
padding property, 598
padding-right property,

404–405, 598

Index Enumerator object, 566 617
event object, 567–568
background-color FileUpload object, 568 navigator.appName:,
(CSS), 593 510–511
filters.alpha.opacity,
background (CSS), 593 navigator.appVersion,
background-image 536–537 512–513
float (CSS), 596
(CSS), 593 font (CSS), 596 navigator.userAgent:,
background-position font-family (CSS), 596 510–511
font-size (CSS), 596
(CSS), 594 font-style (CSS), 596 Number object, 576
background-repeat font-variant (CSS), 596 Object object, 576
font-weight (CSS), 597 Option object, 576–577
(CSS), 594 Form object, 568 padding-bottom (CSS),
backgroundColor, 498–499 Frame object, 569
Boolean object, 561 FrameSet object, 569 404–405, 598
border-bottom (CSS), 594 Function object, 569 padding (CSS), 598
border-bottom-width Global object, 570 padding-left (CSS),
height, browser windows,
(CSS), 594 404–405, 598
border-color (CSS), 594 248–249 padding-right (CSS),
border (CSS), 594 height (CSS), 597
border-left (CSS), 594 Hidden object, 570 404–405, 598
border-left-width History object, 570 padding-top (CSS),
Iframe object, 571
(CSS), 594 Image object, 571 404–405, 598
border-right (CSS), 594 Layer object, 572 Password object, 577
border-right-width left, browser windows and, Plugin object, 577
quick reference, 559
(CSS), 594 250–251 Radio object, 577–578
border-style (CSS), 595 letter-spacing (CSS), 597 Range object, 578
border-top (CSS), 595 line-height (CSS), 597 RegExp object, 579
border-top-width Link object, 573
list-style (CSS), 597 Regular Expression
(CSS), 595 object, 579
border-width (CSS), 595 list-style-image
borderStyle, 442–443 Reset object, 580
browser compatibility, (CSS), 597 resizable, 256–257
screen object, 580
593–599 list-style-position screenX, browser windows
Button object, 562
ccsRule object, 562 (CSS), 597 and, 250–251
Checkbox object, 562 list-style-type (CSS), screenY, browser windows
checked, 182
clear (CSS), 595 597 and, 250–251
color (CSS), 595 Location object, 573–574 Script object, 580–581
Date object, 562 margin-bottom (CSS), 598 scrollTop, 436–437
display (CSS), 595–596 margin (CSS), 597 Select object, 581
document object, 90, margin-left (CSS), 598 String object, 581
margin-right (CSS), 598 style, 390
564–565 margin-top (CSS), 598 Style object, 582–587
document.body.background, Math object, 574 styleSheet object, 587
MimeType object, 575 Submit object, 588
486–487, 488–489 navigator object, 575 tagName, 498–499
document.body.client text-align (CSS), 598
navigator.appCodeName:, text-decoration (CSS),
Height, 344–345, 398–399
document.body.client 510–511 598
text-indent (CSS), 599
Width, 398–399 Text object, 588
document.body.scrollTop, text-transform (CSS), 599

260–261

618 JavaScript in 10 Simple Steps or Less

properties (continued) checked property in radio resizeLayer function, layer
Textarea object, 588–589 buttons, 182 placement, 530–531
top, browser windows and,
250–251 groups, accessing, 182 resizeTo method, 424–425
value, 182 groups, creating, 180 return command
vertical-align (CSS), 599 input tag and, 180
visibility, 394–395, length property, 182 functions and, 202–203
396–397, 490–491 selection changes, 186–187 returning values from
white-space (CSS), 599 selection changes, detecting,
width, browser windows, functions, 58–59
248–249 184–183 rollovers
width (CSS), 599 selection changes, onClick
window object, 236, 589–590 creating with functions,
event handler, 184 134–135
window.innerHeight, selection lists, substitution for,
image maps and, 154–155
344–345, 398–399 180–181 links, triggering with in
selection status, 182–187
window.innerWidth, selection updates, 186–187 different location, 152–153
selection validation, 212–213 location, triggering from
346–347, 398–399 value of selected, 182
value property, 182, 186–187 different, 152–153
window.screen.colorDepth, Radio object, 577–579 menu system, creating,
random, banner ads, 158–159
402–403 random image loading, 130–133 140–141
window.status, 236 random slide show, 144–145 multiple on one page,
word-spacing (CSS), 599 Range object, 578–579
pseudo-classes (CSS), 599 recurring function execution, 128–129
pseudo-elements (CSS), 599 78–79 multiple on one page,
pseudo-persistent data, frames redirection, new pages, 112–113
and, 284–285 RegExp object, 579 functions and, 138–139
pull-down menus switching images
creating, 408–409 Regular Expression
creating multiple, 410–411 programmatically, 126–127
selections, detecting, 412–413 object, 579 triggering, functions and,
selections, reacting to, regular expressions
136–137
412–413 numeric text field validation rotateBanner function, 156
punctuation in phone numbers, and, 228–229 row-resize cursor, 434
rows attribute, frameset
validation and, 206 phone number validation in
forms, 218–219 tag, 278
Q
test method and, 218 S
question mark with arrow variables and, 228
cursor, 434 relative placement sans serif fonts, 360
CSS, 370–371 scheduled functions
quick reference layers (HTML), 522
browser icons, 559 removeDrop function, 354–355 canceling, 80–81
methods, 559 replace method, arguments, 34 introduction, 76–77
properties, 559 replace text, strings, 34–35 recurring, 78–79
Reset object, 580 screen Object, 580
quotation marks, text, 23 resizable property, browser screenX property, browser
windows, 256–257 windows, 250–251
R screenY property, browser
resizeFloatingWindow windows, 250–251
radio buttons script blocks
checked attribute, 180 function, 424–425 creation, 2–3
checked property, 182, images, displaying multiple
186–187
random, 132
map block, 154
Script object, 580–581

Index 619

script tags choice validation, 210–211 slide shows
introduction, 2–3 content, dynamically captions, 148–149
src attribute, 8–9 creating, 142–143
changing, 174–175 randomizing, 144–145
scripts length property, 172–173 transitions triggering from
command deletion, 14–15 length property, content links, 146–147
comments, 10–11
multiple, adding, 82–83 changes and, 174–175 slideShow function, 142
navigation and, 232–233 slideSpeed variable
scroll bars onClick event handler and
browser windows, 254–255 offscreen content, 446–447
position determination, content changes, 174–175 sliding menus and, 448–449
436–437 options array, 172–173 sliding elements with X, 554–555
options property, 172–173 sliding menus, creating, 448–449
scrollbars property, browser populating programmatically, small method, strings, 36
windows, 254–255 sort method, 44
172–173 sorts, arrays, 44–45
scrollCheck function, scroll radio button use instead of, spacing
position, 436–437 CSS, 366–367
180–181 line spacing (CSS), 328–329
scrollDocument function, responding to user selections, span tag
browser windows, 260 lowercase, 400–401
470–471 object placement in new
scrolling selectedIndex property,
auto-scrolling, 450–451 browsers and, 581–519
browser window control, 178–179 uppercase, 400–401
260–261 selection status, 176–177 split method
position determination, updating based on selections cookies and, 304
436–437 introduction, 46
window object and, 236 in another list, 178–179 splitting strings, delimiters and,
self keyword, window object 46–47
scrolling cursor, 434 src attribute, script tag, 8–9
scrollPage function, auto- and, 236 stacking order of layers, 534–535
serif fonts, 360 statements
scrolling, 450–451 sessions, tracking with cookies, if, 68–69
scrollTop property, scroll bar var, 20–21
310–311 status bar, text, window.status
position, 436–437 setCookie function, 322–323 property, 236
searches setHours method, outputting strike method, strings, 36
string data types, 24
strings, text in, 32–33 date/time and, 98–99 String object
Yahoo!, Internet Explorer setOpacity function, fading methods, 581–582
properties, 581
with bookmarklets, 504–505 objects and, 536–537 split method, 304
Yahoo!, Netscape with setTimeout method text strings, 36–37
strings
bookmarklets, 506–507 animated banners, 156 concatenation, 30–31
secondList function, 178–179 scheduled functions, 76–77 document.cookie object,
security, cookies and, 304–305 sharing code, between frames,
Select object, 581 282–283 304
select tag, selection lists, short-form condition testing, document.write method
70–71
170–171 showLayer function and, 36–37
selectButton function, radio layer visibility and, 532–533 formatting, 36–37
sliding menus, 448–449
buttons, 186–187 showObject function, 396–397
selectedIndex property, single-line comments, 10–11
sizeToContent method,
selection lists, 178–179 browser windows, 276–277
selection lists slashes (//) in comments, 10

access, 170–171
changeList function,

174–175

620 JavaScript in 10 Simple Steps or Less

strings (continued) Submit object, 588 text-decoration property,
formatting, multiple, 38–39 submitting forms CSS, 598
quotation marks, 23
replace method, 34 encryption and, 230–231 text fields
splits, delimiters and, 46–47 URL, controlling, 226–227 content access, 164–165
text in, replacing, 34–35 sup method, strings, 36 detecting changes in, 168–169
text in, searches, 32–33 swapLayer function dynamically updating,
unescape function, 304 layer ordering, 534–535 166–167
layers, 358–359 input tag, 168–169
style attribute numeric, validating with
div tag, 329 T regular expressions, 228–229
height property, 344–345 onClick event handler, 164
tagName property, links, responding to changes in,
Style object, 582–587 highlighting with bookmarklets, 458–459
style object, 328 498–499
style property text-indent property,
tags CSS, 599
diagonal movement of objects, calling functions from, 62–63
338–339 div, 329 Text object, 588
meta, 538–539 text-transform attribute
horizontal movement of noscript, 6–7
objects, 334–335 option, 170–171 CSS, 599
select, 170–171 forcing capitalization and,
left attribute, 330–331
object placement and, test method, regular 400–401
expressions and, 218 Textarea object, 588–589
332–333 three-dimensional movement,
page fonts, changing with testing, if images loaded, 150–151
text moveObject function and,
bookmarklet, 496–497 342–343
style sheet settings access, 390 alignment (CSS), 364–365 time. See date and time
style sheet settings bold, 362–363 time zone
color, changing with X library,
modifications, 392–393 date output and, 98–99
top attribute, 330–331 546–547 GMT, 98–99
vertical movement of objects, data types, 24 Universal Time Coordinate,
first line, customizing (CSS),
336–337 98–99
styles 384–385 today variable, date and time
font style (CSS), 362–363
capitalization, forcing, fonts (CSS), 360–361 check with bookmarklet,
400–401 highlighting menu creation, 500–501
toggleMenu function
cursors, changing, 434–435 440–441, 442–443
document style sheets, italic, 362–363 expanding/collapsing
quotation marks, 23 functions, 438
376–377 size, 362–363
first line of all elements on strings, replacing, 34–35 highlighting menu
strings, searches, 32–33 creation, 443
page, 386–387 underlined, 362–363
inline (CSS), 374–375 text-align attribute, 364–365 toGMTString method
links (CSS), 388–389 text-align property, CSS, 598 cookie expiration, 308–309
style sheet files, global, text cursor, 434 date and time, 100
text-decoration attribute,
378–379 362–363 toLocaleString method
styleSheet object, 587–588 date and time, 100
sub method, strings, 36 date and time, checking with
submit buttons, image buttons bookmarklets, 500–501

as, 224
submit method, form buttons,

multiple, 220

Index 621

toLowerCase method, frames, multiple from another V
strings, 36 link, 292–293
validation
toolbars, browser window radio button selections, check box selection, 214–215
visibility, 252–253 186–187 credit card numbers in forms,
208–209
top attribute selections, 178–179 e-mail addresses in forms,
div tag, 356–357 text fields, dynamic updates, 202–203
layer placement, HTML numeric text fields, regular
and, 522 166–167 expressions and, 228–229
object location, 330–331 uppercase, changing all to, passwords in forms, 216–217
object placement and, phone numbers in forms,
332–333 400–401 206–207
URLs (Uniform Resource phone numbers in forms,
Top Navigational Bar IV, regular expressions and,
downloading, 418 Locators) 218–219
browser window creation and, radio button selections,
top property, browser windows, 244–245 212–213
250–251 form submission, controlling, selection list choices, 210–211
226–227 zip codes in forms, 204–205
topTarget argument, loaded document,
swapLayer function, 358–359 value attribute, check boxes,
document.location 188, 190–191
tostring method, date
object, 96 property and, 258 value property, radio buttons,
parameter values, 107 182, 186–187
toUpperCase method, variables, custom output and,
strings, 36 values, returning from functions,
106–107 58–59
toUTCString method, date and user input, window object
time, 100 var statement, 20–21
and, 236 variables
tracking user sessions, cookies user interaction
and, 310–311 browser detection, building,
pull-down menu creation, 516–517
transitioning pages, Internet 408–409
Explorer, 538–539 creating, 20–21
pull-down menus, creating declaring, 20–21
transitionList array, two, 410–411 dropObject, 354–355
animated banners, 156 frames and, 284
usernames, cookies, displaying, imageList, 484–485
transitions in slide shows, 306–307 leftPosition, 448–449
triggering from links, 146–147 naming, 20–21
users newScroll, 450–451
type attribute, input tag, background color replacement numeric variables, creation,
168–169 with bookmarklets, 486–487
leaving page, executing code 26–27
U and, 468–469 origScroll, 450–451
new, home page changes with outputting, 22–23
underlined text, 362–363 cookies, 320–321 persistentVariable, 284
unescape function, strings, 304 responding to clicks, 456–457 regular expressions and, 228
unnamed frames, referencing selection list actions, slideSpeed, 448–449
responding to, 470–471 today, 500–501
numerically, 298–299 text field input, responding to, URLs, custom output and,
updates 458–459
tracking sessions with cookies, 106–107
bookmarklets, checking, 310–311
476–477
UTC (Universal Time
browser window content from Coordinate), 98–99, 100–101,
another window, 266–267 308–309

frame content, dynamic,
296–297

frames, from another frame,
280–281

622 JavaScript in 10 Simple Steps or Less

verification, form fields, 196–197 introduction, 236 browser window resizing,
version of browser location property, 112 256–257
methods, 236, 590–592
detecting, 512–513 opening browser windows, 244 browser window scroll bars,
detecting, object testing, 514 opening pages in browser 256–257
vertical-align property,
CSS, 599 windows, 236 browser window size control,
vertical centering, 344–345 prompt method, 242–243 248–249
vertical movement of objects, prompts, 242–243
336–337 properties, 236, 589–590 browser window toolbar
vertical-text cursor, 434 self keyword and, 236 display, 256–257
Visa card numbers, 208 user input dialog boxes, 236,
visibility attribute, layers, floating windows, 420–421
HTML, 526–527 242–243 full screen windows in
visibility property, 394–395, window.alert method
396–397 Internet Explorer, 262–263
visitCookie, 320–321 arguments, 90 opening browser window at
void function, bookmarklets, dialog boxes, 50
484–485 link, 246–247
window.clearTimeout page loading placeholder,
W
method, scheduled functions, 114–115
wait cursor, 434 80–81 window.pageYOffset, auto-
while command, loops, 72–73 window.close method
white-space property, CSS, scrolling, 450–451
browser windows, 270–271, windows
599 272–273
width attribute, layers, HTML floating, closing, 422–423
page loading placeholder, floating, content changes,
and, 524–525 114–115
width property 428–429
URLs in href attribute, 273 floating, creating, 420–421
browser window, 248–249 window.confirm method floating, moving, 426–427
CSS, 599 floating, resizing, 424–425
window keyword, window object click responses, 456–457 links, opening all in new
and, 236 condition testing, loops,
window object window with bookmarklet,
access, 236 70–71 494–495
alert dialog boxes, 236 introduction, 52–53
alert dialog boxes, creating, window.innerHeight property window.screen.colorDepth
browser window size, 398–399
238–239 vertical centering and, property, 402–403
browser window creation, window.setTimeout method
344–345
244–245 window.innerWidth property animated banners, 156
browser window size, 236 scheduled functions, 76–77
closing browser windows, browser window size, 398–399 slide shows and, 142
horizontal centering, 346–347 window.status property
270–271 window.location, navigation status bar text, 236
confirmation dialog boxes, and, 232–233 window object, 236
window.location property, word-spacing attribute,
236, 240–241 112–113 366–367
document scrolling, 236 window.open method word-spacing property, CSS,
function execution browser window creation, 599

scheduling, 236 244–245 X
browser window location
X library, 540
setting, 250–251 background color, 548–549
background images, setting,
550–551


Click to View FlipBook Version