Home > Articles > Open Source > Ajax & JavaScript

  • Print
  • + Share This
This chapter is from the book

Quiz

Test your knowledge of JavaScript windows and frames by answering the following questions.

Questions

  1. Which of the following methods displays a dialog box with OK and Cancel buttons, and waits for a response?

    1. window.alert

    2. window.confirm

    3. window.prompt

  2. What does the window.setTimeout method do?

    1. Executes a JavaScript statement after a delay.

    2. Locks up the browser for the specified amount of time.

    3. Sets the amount of time before the browser exits automatically.

  3. You're working with a document that contains three frames with the names first, second, and third. If a script in the second frame needs to refer to the first frame, what is the correct syntax?

    1. window.first

    2. parent.first

    3. frames.first

Answers

  1. b. The window.confirm method displays a dialog box with OK and Cancel buttons.

  2. a. The window.setTimeout method executes a JavaScript statement after a delay.

  3. b. The script in the second frame would use parent.first to refer to the first frame.

  • + Share This
  • 🔖 Save To Your Account