MCQs > IT & Programming > Ajax > function loadDoc() { varxhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 3 &&this.status == 200) { console.log(this.responseText); } }; xhttp.open('GET', ;'cd_catalog.xml', true); xhttp.send(); }

Ajax MCQs

What is wrong in the following function ? function loadDoc() { varxhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 3 &&this.status == 200) { console.log(this.responseText); } }; xhttp.open("GET", "cd_catalog.xml", true); xhttp.send(); }

Answer

Correct Answer: In line 4, the comparison of this.readyState should be with 4

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