Student Center
|
Instructor Center
|
Information Center
|
Home
Sample Code
Choose a Chapter
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
Chapter 15
Chapter 16
Chapter 17
Multiple Choice Quiz
True or False
E-Lectures
Feedback
Help Center
Programming the Web Using XHTML and JavaScript
Larry Randles Lagerstrom
Strings, Dates, and Cookies
Multiple Choice Quiz
1
Which statement immediately terminates execution of a loop?
A)
exit
B)
break
C)
quit
D)
kill
2
For simple cookies, which field is typically omitted?
A)
name
B)
expiration date
C)
pathname of the web page writing the cookie
D)
value
3
The cookie string is actually written to:
A)
a hard drive on the server
B)
the surfer's hard drive
C)
both A and B
D)
neither A nor B
4
Which statement can be used to examine the value of the cookie string associated with the current web page?
A)
alert(cookie)
B)
alert(document.cookie.value)
C)
alert(this.cookie)
D)
alert(document.cookie)
5
Given a Date object named expDate that is set to the current date and time, which of the following will change the date value to one week from now?
A)
expDate = setWeek(1)
B)
expDate.setTime(expDate.getTime() + 30*24*3600*1000)
C)
expDate.setTime(expDate.getTime() + 7*24*60*60)
D)
expDate.setTime(expDate.getTime() + 7*24*3600*1000)
6
Which of the following creates a cookie named userName and stores the value Rocky in it?
A)
document.cookie = "userName=Rocky"
B)
document.cookie("userName", "Rocky")
C)
document.cookie.name = "userName", document.cookie.value = "Rocky"
D)
cookiename = "userName", cookievalue = "Rocky"
2003 McGraw-Hill Higher Education
Any use is subject to the
Terms of Use
and
Privacy Policy
.
McGraw-Hill Higher Education
is one of the many fine businesses of
The McGraw-Hill Companies
.