MCQs > IT & Programming > Ajax > var xhttp, xmlDoc, txt, x, i; xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { xmlDoc = this.responseXML; txt = ""; x = xmlDoc.getElementsByTagName("QUESTION"); for (i = 0; i < x.length; i++) { txt = txt + x[i].childNodes[0].nodeValue + " "; } document.getElementById("demo").innerHTML = txt; } }; xhttp.open("GET", "questions.xml", true); xhttp.send();

Ajax MCQs

What does the following code do? var xhttp, xmlDoc, txt, x, i; xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { xmlDoc = this.responseXML; txt = ""; x = xmlDoc.getElementsByTagName("QUESTION"); for (i = 0; i < x.length; i++) { txt = txt + x[i].childNodes[0].nodeValue + "
"; } document.getElementById("demo").innerHTML = txt; } }; xhttp.open("GET", "questions.xml", true); xhttp.send();

Answer

Correct Answer: responseXML gets response as XMLDocument

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Ajax Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Ajax Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it