summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorNo'am Rosenthal <noam.rosenthal@nokia.com>2011-07-13 17:13:11 -0700
committerNo'am Rosenthal <noam.rosenthal@nokia.com>2011-07-13 17:13:11 -0700
commit196f57c034b3deb96f87d1a91011d5be21813b0c (patch)
tree763eed7102458b40c0a3d00c2a77d20d07f0b554 /examples
parente255b6e3b03fb8c944a82fcd0a70880bccdad7e2 (diff)
downloadqtwebchannel-196f57c034b3deb96f87d1a91011d5be21813b0c.tar.gz
Remove some dead code
Diffstat (limited to 'examples')
-rw-r--r--examples/qmlapp/index.html29
-rw-r--r--examples/qmlapp/qmlapp.qml2
2 files changed, 21 insertions, 10 deletions
diff --git a/examples/qmlapp/index.html b/examples/qmlapp/index.html
index e1a4bf6..2fc9715 100644
--- a/examples/qmlapp/index.html
+++ b/examples/qmlapp/index.html
@@ -2,17 +2,28 @@
<head>
<script src="../../src/qwebchannel.js"></script>
<script>
- function load() {
- navigator.webChannel.subscribe("incoming-call",
- function(message) { debug(message); }
+ window.onload = function() {
+ var textArea = document.querySelector("textarea");
+ function debug(x) {
+ textArea.value = textArea.value + x + "\n";
+ }
+
+ navigator.webChannel.subscribe(
+ "incoming-call",
+ function(message) {
+ debug(message);
+ }
);
- navigator.webChannel.exec({a:"This is a request from HTML"}, function(response) {
- debug(response.b);
- });
- }
+ navigator.webChannel.execute(
+ {a:"This is a request from HTML"},
+ function(response) {
+ debug(response.b);
+ }
+ );
+ };
</script>
</head>
- <body onload="load()">
- <div>444</div>
+ <body>
+ <textarea style="width: 100%; height: 100%"></textarea>
</body>
</html>
diff --git a/examples/qmlapp/qmlapp.qml b/examples/qmlapp/qmlapp.qml
index 4f7aafe..b6049a6 100644
--- a/examples/qmlapp/qmlapp.qml
+++ b/examples/qmlapp/qmlapp.qml
@@ -8,7 +8,7 @@ Rectangle {
WebChannel {
id: webChannel
- onRequest: {
+ onExecute: {
var data = JSON.parse(requestData );
txt.text = data.a;
response.send(JSON.stringify({b:'This is a response from QML'}));