PrepAway - Latest Free Exam Questions & Answers

Which line of code initializes the XMLHttpRequest object?

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?

PrepAway - Latest Free Exam Questions & Answers

A.
xmlhttp.send();

B.
var xmlhttp = new XMLHttpRequest();

C.
xmlhttp.open(“GET”, “fish.xml”, true);

D.
xmlhttp.onreadystatechange = showFish();

Explanation:

PrepAway - Latest Free Exam Questions & Answers

Leave a Reply