... Analysis of Figure 11 -11 210
Summary 213
Assignment 214
12
SAVING VISITOR INFORMATION WITH COOKIES 215
A Real-World Example of Cookies 216
What Are Cookies? 216
What Cookies Can and Can’t Do 217
Working ... 411
alert() 413
Anchor 413
Applet 413
Area 414
Array 414
Button (Including Submit and Reset Buttons) 416
Checkbox 417
clearInterval() 417
clearTimeout() 417
confirm...
... click the link, an alert box should come up and say Off to the Book
of JavaScript! (Figure 4-6). When you click OK in the box, the page should
load the Book of JavaScript website.
Figure 4-6: The ... "alert('Off to the Book of JavaScript! ');">Visit the Book of
JavaScript website</a>
Figure 4-5: A link that calls an alert
Try...
... the
mouse JavaScript directs your browser to a page of information about that
chapter. Figure 7 -3 shows the navigation element on the Book of JavaScript
home page.
Figure 7 -3: The Book of JavaScript
home ... sets the left border of the window you’re moving. If you move
the left border of the window into the center of the screen, the window will...
... X. The first line in the body of the func-
tion then swaps the image stored in position 0 of
the_ images with the image
on the page. If
rotateImage(1) was called instead of rotateImage(0), the ... species of ants live in various counties in the
1 54 Chapter 9
any JavaScript on the page (including the JavaScript inside the onClick of
the stop timer b...
... indexOf(), the lastIndexOf() method gives you the
position of the last occurrence of a character or substring. Table 11-1 shows
the value of various calls to
indexOf() and lastIndexOf() when the ... string.
The variable
two_slashes holds the value 5 because the two slashes start at
position 5. Line Y grabs everything two characters from the beginning of
the...
... Detecting the position of the mouse
2 46 Chapter 13
node to the end of the list of the parent’s children. If our parent is the body of
the document, that puts the
div at the end of the document. ... along the colon. It
then loads the first part of the element into
the_ property and the second part
into
the_ value.
The first time through the l...
... into which the results of
the script will be placed. The
ems you see in the style of the div set the width
of the
div equal to some multiple of the width of the letter m (em) in the font
being ... browser, the script will automatically adjust the
width of the
div. The JavaScript code will automatically change the height
of the
div as the...
... "HEAD", then all the
PHP script should do is send the header information in X. If it is not a
HEAD
request, then the body of the
if-then clause reads the contents of the file into
the
$contents ... false;">odysseus</a>
The body of the link is the name of the available list (shown here as odysseus).
An
onClick inside the link calls rea...
... Date();
var the_ hours = the_ date.getHours();
If the clock on the computer running the JavaScript thinks it’s 8 PM,
the_ hours contains the number 20.
Methods for Getting the UTC Date and Time
The following ... the_ hours = the_ hours - 4;
} else if (the_ zone == "sanfran") {
the_ hours = the_ hours - 7;
} else if (the_ zone == "tokyo") {
the_ ho...
... parameters: the position of
the first character of the substring and the length of the substring. Similar
to the
substring() method.
Reference to JavaScript Objects and Functions 431
Link
The hypertext ... to the upper left corner of
the screen. The content area is where the web page resides.
screenX
FF Horizontal coordinate of the left side of the w...
... Text Fields 10 9
Setting the Value of a Text Field 11 0
Textareas 11 1
Checkboxes 11 2
Radio Buttons 11 4
Pull-Down Menus and Scrollable Lists 11 5
Handling Events Using Form Elements 11 6
Make this ... Analysis of Figure 11 -11 210
Summary 213
Assignment 214
12
SAVING VISITOR INFORMATION WITH COOKIES 215
A Real-World Example of Cookies 216
What Are Cookies? 216
What Co...
... sets the left border of the window you’re moving. If you move
the left border of the window into the center of the screen, the window will
be too far to the right. To get the window to the center ... see whether thisIsThau contains
the value
true. Instead, I’m just putting the variable inside the if-then test
parentheses. The
if-then rule states, “If the...
... shows you what each of these elements looks like,
and Figure 7-7 shows you the HTML used to draw Figure 7-6.
136 Chapter 8
How the Book of JavaScript Tip Box Works
The Book of JavaScript website ... most of the part identifying the form,
window.document .the_ form, with the word this, which refers to the thing that
contains it. For example, in X of Figure 7-25,...
... along the colon. It
then loads the first part of the element into
the_ property and the second part
into
the_ value.
The first time through the loop,
the_ property is "name" and the_ value
is
"thau". ... brainteaser—find all the Fs in
the text.
In the HTML, the block of text is
contained in a
div. Clicking on the link
makes the Fs bigge...