4 property string url: "testdocument.html"
6 property bool readyState: false
7 property bool openedState: false
9 property bool status: false
10 property bool statusText: false
11 property bool responseText: false
12 property bool responseXML: false
14 property bool dataOK: false
16 Component.onCompleted: {
17 var x = new XMLHttpRequest;
20 if (x.readyState == XMLHttpRequest.UNSENT)
24 x.setRequestHeader("Accept-Language", "en-US");
29 x.setRequestHeader("Accept-Language", "en-US");
31 if (x.readyState == XMLHttpRequest.OPENED)
37 if (error.code == DOMException.INVALID_STATE_ERR)
43 if (error.code == DOMException.INVALID_STATE_ERR)
46 responseText = (x.responseText == "");
47 responseXML = (x.responseXML == null);
50 x.onreadystatechange = function() {
51 if (x.readyState == XMLHttpRequest.DONE) {
52 dataOK = (x.responseText == "QML Rocks!\n");