equal
deleted
inserted
replaced
|
1 import Qt 4.7 |
|
2 |
|
3 QtObject { |
|
4 property bool dataOK: false |
|
5 property bool test: false |
|
6 |
|
7 Component.onCompleted: { |
|
8 var x = new XMLHttpRequest; |
|
9 x.open("GET", "testdocument.html"); |
|
10 x.setRequestHeader("Accept-Language","en-US"); |
|
11 |
|
12 // Test to the end |
|
13 x.onreadystatechange = function() { |
|
14 if (x.readyState == XMLHttpRequest.DONE) { |
|
15 dataOK = (x.responseText == "QML Rocks!\n"); |
|
16 } |
|
17 } |
|
18 |
|
19 x.send(); |
|
20 |
|
21 try { |
|
22 x.send() |
|
23 } catch (e) { |
|
24 if (e.code == DOMException.INVALID_STATE_ERR) |
|
25 test = true; |
|
26 } |
|
27 } |
|
28 } |