Practice Quiz 2

  1. frames always load in a particular order
    A. true
    B. false

var str = "Apples are round, apples are juicy, and apples are sometimes red.";
var replStr = /apples/i;
var newStr = str.replace(replStr, "oranges");

  1. document.frmRepl.result.value = newStr;
    the result will be
    A. Apples are round, oranges are juicy, and apples are sometimes red.
    B. Apples are round, oranges are juicy, and oranges are sometimes red.
    C. oranges are round, apples are juicy, and apples are sometimes red.
    D. oranges are round, oranges are juicy, and oranges are sometimes red.

str = "one two three four five";
str = str.replace(/(\w+) *(\w+) *(\w+)/, "$3 $2 $1");

  1. the result will be
    A. five four three two one
    B. three two one four five
    C. one two five four three
    D. none of the above
  1. There is no way to center a newly opened window
    A. true
    B. false
  1. the following are parameters for open()
    A. features
    B. URL
    C. target Name or window Name
    D. methods
  1. the second parameter for open() is necessary when we want to be able "target" that window
    A. true
    B. false
  1. the child window refers to the window that opened it as the parent
    A. true
    B. false
  1. the following are methods of the window
    A. write()
    B. setTimeout()
    C. prompt()
    D. focus()

For Question 9

</SCRIPT>

var newWindow;

function openWindow() {
          newWindow = window.open('', 'newWin',
          'toolbar=yes,location=yes,scrollbars=yes,width=300,height=200')
}

</SCRIPT>

<A HREF="javascript:openWindow()">Open a new window</A>
<A HREF="javascript:newWindow.close()">Close a new window</A>

  1. one link opens a new window while the other link closes the window
    A. true
    B. false
  1. someWin.focus() brings someWin to the front
    A. true
    B. false

You have:    answers correct out of a possible ten.

The question numbers that were not correct are: