Answers for "ajax request qml"

0

ajax request qml

function makeRequest()
{

    var doc = new XMLHttpRequest();
    msg.text = "";
    doc.onreadystatechange = function() {
        if (doc.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
            showRequestInfo("Headers -->");
            showRequestInfo(doc.getAllResponseHeaders ());
            showRequestInfo("Last modified -->");
            showRequestInfo(doc.getResponseHeader ("Last-Modified"));

        } else if (doc.readyState == XMLHttpRequest.DONE) {
            var a = doc.responseXML.documentElement;
            for (var ii = 0; ii < a.childNodes.length; ++ii) {
                showRequestInfo(a.childNodes[ii].nodeName);
            }
            showRequestInfo("Headers -->");
            showRequestInfo(doc.getAllResponseHeaders ());
            showRequestInfo("Last modified -->");
            showRequestInfo(doc.getResponseHeader ("Last-Modified"));
        }
    }

    doc.open("GET", "data.xml");
    doc.send();
}
Posted by: Guest on April-24-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language