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?

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?

A.
xmlhttp.send();

B.
var xmlhttp = new XMLHttpRequest();

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

D.
xmlhttp.onreadystatechange = showFish();

Explanation:



Leave a Reply 0

Your email address will not be published. Required fields are marked *