McGraw-Hill OnlineMcGraw-Hill Higher EducationLearning Center
Student Center | Instructor Center | Information Center | Home
Sample Code
Multiple Choice Quiz
True or False
E-Lectures
Feedback
Help Center


Programming the Web Using XHTML and JavaScript
Larry Randles Lagerstrom

JavaScript with Frames and Windows

Multiple Choice Quiz



1

Which statement writes the element <b> Hello </b> into a document?
A)document.write(<b> Hello </b>)
B)document.write("<b> Hello </b>")
C)document.write('<b>' + ' Hello ' + '</b>')
D)both B and C
2

Which statement writes the cookie string for the current document into the document itself?
A)document.write("document.cookie")
B)write(document.cookie)
C)document.write(cookie)
D)none of the above
3

Which statement writes the value of a variable named userName into a document?
A)window.write(userName)
B)document.write(userName)
C)document.write(userName.value)
D)document.print(userName)
4

When dynamically generating a web page by using document.write statements, it's important to call which method to properly finish the writing process?
A)document.close()
B)window.close()
C)outputStream.close()
D)document.output.close()
5

Which of these comprise the Browser Object Model?
A)the window object and its sub-objects
B)the document object and its sub-objects
C)the navigator object and its sub-objects
D)the page object and its sub-objects
6

Which of these comprise the Document Object Model?
A)the window object and its sub-objects
B)the document object and its sub-objects
C)the navigator object and its sub-objects
D)the page object and its sub-objects
7

Suppose a frameset document defines three frames named side, topright, and main, and also contains a function named zap(). A document named buttons.html is loaded into the side frame. Which of the following event handlers in buttons.html correctly calls zap()?
A)onclick = "frameset.parent.zap()"
B)onclick = "main.zap()"
C)onclick = "parent.zap()"
D)onclick = "zap()"
8

Suppose a frameset document defines three frames named side, topright, and main, and also contains a function named zap(). Which of the following statements could be used in zap() to write the message "You're It!" in the main frame?
A)frames[0].document.write("You're It!")
B)child.document.write("You're It!")
C)parent.write("You're It!")
D)main.document.write("You're It!")
9

Suppose a frameset document defines three frames named side, topright, and main. A document named buttons.html is loaded into the side frame, and it contains a function named zap(). Which statement could be used in zap() to write the message "You're It!" in the topright frame?
A)frames[0].document.write("You're It!")
B)sibling.document.write("You're It!")
C)parent.topright.document.write("You're It!")
D)main.document.write("You're It!")
10

Which of the following statements opens a new browser window and brings it to the front of all the other windows?
A)var w = new Window()
B)var w = window.open().blur()
C)var w = window.open().focus()
D)var w = window.open().top()




McGraw-Hill/Irwin