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)- A9% (2)
- B4% (1)
- C83% (19)
- D4% (1)
Community Discussion
No community discussion yet for this question.