nerdexam
CIW

1D0-635 · Question #21

Consider the following code fragment, which sets up the retrieval of an XML document named fish.xml and calls a function named showFish(): var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET"…

The correct answer is C. xmlhttp.open("GET", "fish.xml", true). See the full explanation below for the reasoning.

Question

Consider the following code fragment, which sets up the retrieval of an XML document named fish.xml and calls a function named showFish():

var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "fish.xml", true); xmlhttp.onreadystatechange = showFish(); xmlhttp.send(); Which line of code initializes the XMLHttpRequest object?

Options

  • Axmlhttp.send();
  • Bvar xmlhttp = new XMLHttpRequest();
  • Cxmlhttp.open("GET", "fish.xml", true);
  • Dxmlhttp.onreadystatechange = showFish();

How the community answered

(23 responses)
  • A
    9% (2)
  • B
    4% (1)
  • C
    83% (19)
  • D
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 1D0-635 Practice