diff options
author | No'am Rosenthal <noam.rosenthal@nokia.com> | 2011-08-08 10:37:14 -0700 |
---|---|---|
committer | No'am Rosenthal <noam.rosenthal@nokia.com> | 2011-08-08 10:37:14 -0700 |
commit | 3f07d1b1f729c2476bd6dc8783b10af72f264b54 (patch) | |
tree | 8dd43eab4fb9f28306aa8017c20ff3c62ed2b161 /examples | |
parent | 5c8e0d25efe2a7d9947dce3d1e867afb13099c60 (diff) | |
download | qtwebchannel-3f07d1b1f729c2476bd6dc8783b10af72f264b54.tar.gz |
Switched to using http POST for exec/subscribe
Diffstat (limited to 'examples')
-rw-r--r-- | examples/qmlapp/index.html | 4 | ||||
-rw-r--r-- | examples/qmlapp/qmlapp.qml | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/examples/qmlapp/index.html b/examples/qmlapp/index.html index 40843a7..a000d52 100644 --- a/examples/qmlapp/index.html +++ b/examples/qmlapp/index.html @@ -1,7 +1,7 @@ <html> <head> <script> - document.write('<script src="' + (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/]+)/.exec(location.search)[1]) + '"><' + '/script>'); + document.write('<script src="' + (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/]+)/.exec(location.search)[1]) + '/webchannel.js/createWebChannel"><' + '/script>'); function output(x) { document.querySelector("#out").innerHTML += x + "<br/>"; @@ -9,7 +9,7 @@ </script> <script> window.onload = function() { - navigator.createWebChannel(function(c) { + createWebChannel(function(c) { c.subscribe( "foobar", function(message) { diff --git a/examples/qmlapp/qmlapp.qml b/examples/qmlapp/qmlapp.qml index 8a9122e..1ed177b 100644 --- a/examples/qmlapp/qmlapp.qml +++ b/examples/qmlapp/qmlapp.qml @@ -9,6 +9,7 @@ Rectangle { id: webChannel onExecute: { + console.log(requestData); var data = JSON.parse(requestData); txt.text = data.a; response.send(JSON.stringify({b:'This is a response from QML'})); @@ -26,6 +27,9 @@ Rectangle { anchors.top: txt.bottom height: 2000 width: 2000 + onAlert: { + console.log(message); + } } TextEdit { |