summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml
blob: 8c337d9332954b0d8cbdf06bdcf6b81f918e3d5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import QtQuick 1.0

QtObject {
    property string url

    property bool dataOK: false
    property bool done: false

    Component.onCompleted: {
        var x = new XMLHttpRequest;
        x.open("GET", url);

        x.onreadystatechange = function() {
            if (x.readyState == XMLHttpRequest.DONE) {
                done = true;
                dataOK = x.status == 302;
            }
        }

        x.send();
    }
}