PrepAway - Latest Free Exam Questions & Answers

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.)

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:

2 Comments on “How should you complete the relevant code?

  1. brkyctn says:

    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




    1



    0

Leave a Reply