summaryrefslogtreecommitdiffstats
path: root/examples/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-09-01 03:38:08 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-09-01 03:38:08 (GMT)
commit49e4975e96ac9e2e8e6af1c58d3ed1453a130eb4 (patch)
tree30595ddf8401cdde3f0c7fdfb233e8ddcb600e70 /examples/declarative
parent671c3ac47a258a876352a4c4d38937e0fb7034a7 (diff)
downloadQt-49e4975e96ac9e2e8e6af1c58d3ed1453a130eb4.zip
Qt-49e4975e96ac9e2e8e6af1c58d3ed1453a130eb4.tar.gz
Qt-49e4975e96ac9e2e8e6af1c58d3ed1453a130eb4.tar.bz2
Implement more of XMLHttpRequest
Diffstat (limited to 'examples/declarative')
-rw-r--r--examples/declarative/xmlhttprequest/test.qml26
-rw-r--r--examples/declarative/xmlhttprequest/test.xml5
2 files changed, 31 insertions, 0 deletions
diff --git a/examples/declarative/xmlhttprequest/test.qml b/examples/declarative/xmlhttprequest/test.qml
new file mode 100644
index 0000000..56366d6
--- /dev/null
+++ b/examples/declarative/xmlhttprequest/test.qml
@@ -0,0 +1,26 @@
+import Qt 4.6
+
+Rectangle {
+ width: 800; height: 600
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: {
+
+ var doc = new XMLHttpRequest();
+ doc.onreadystatechange = function() {
+ if (doc.readyState == XMLHttpRequest.DONE) {
+
+ var a = doc.responseXML.documentElement;
+ for (var ii = 0; ii < a.childNodes.length; ++ii) {
+ print (a.childNodes[ii].nodeName);
+ }
+
+ }
+ }
+
+ doc.open("GET", "test.xml");
+ doc.send();
+ }
+ }
+}
diff --git a/examples/declarative/xmlhttprequest/test.xml b/examples/declarative/xmlhttprequest/test.xml
new file mode 100644
index 0000000..8b7f1e1
--- /dev/null
+++ b/examples/declarative/xmlhttprequest/test.xml
@@ -0,0 +1,5 @@
+<data>
+ <element1 />
+ <element2 />
+</data>
+