How should you complete the relevant code?

HOTSPOT
A company has an XML file named products.xml on a web server. The file contains a list of
the products that the company sells.
You need to display the contents of the products.xml file in a DIV element named Output.
How should you complete the relevant code? (To answer, select the appropriate option from
each drop-down list in the answer area.)

HOTSPOT
A company has an XML file named products.xml on a web server. The file contains a list of
the products that the company sells.
You need to display the contents of the products.xml file in a DIV element named Output.
How should you complete the relevant code? (To answer, select the appropriate option from
each drop-down list in the answer area.)

Answer:

Explanation:



Leave a Reply 2

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


brkyctn

brkyctn

Example
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById(“myDiv”).innerHTML=xmlhttp.responseText;
}

}
Note:
* readyState == 4
Holds the status of the XMLHttpRequest. Changes from 0 to 4:
0: request not initialized
1: server connection established
2: request received
3: processing request
4: request finished and response is ready
* status==200
200: “OK”
404: Page not found
Reference: AJAX – The onreadystatechange Event