summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorNo'am Rosenthal <noam.rosenthal@nokia.com>2011-08-04 16:03:29 -0700
committerNo'am Rosenthal <noam.rosenthal@nokia.com>2011-08-04 16:03:29 -0700
commit12572d8caf4125f4a801db56ab0ab75da60ad728 (patch)
tree8ff6b686f3eea14478ef47f912454e787fc69292 /examples
parentf5190dd16e47635a106cda7a1dec45198db87f1b (diff)
downloadqtwebchannel-12572d8caf4125f4a801db56ab0ab75da60ad728.tar.gz
Switch to using an IFrame
Diffstat (limited to 'examples')
-rw-r--r--examples/qmlapp/index.html23
1 files changed, 7 insertions, 16 deletions
diff --git a/examples/qmlapp/index.html b/examples/qmlapp/index.html
index 0dcc507..71b08f2 100644
--- a/examples/qmlapp/index.html
+++ b/examples/qmlapp/index.html
@@ -10,22 +10,7 @@
return pair[1];
}
}
- document.write('<script src="' + getWebChannelBaseUrl() + '"><' + '/script>');
-
- window.onload = function() {
- var textArea = document.querySelector("textarea");
- function output(x) {
- textArea.value = textArea.value + x + "\n";
- }
-
- navigator.webChannel.subscribe(
- "incoming-call",
- function(message) {
- output(message);
- }
- );
- };
-
+ document.write('<script src="' + getWebChannelBaseUrl() + '"><' + '/script>');
function output(x)
{
document.querySelector("#out").innerHTML = x;
@@ -33,6 +18,12 @@
function send()
{
+ navigator.webChannel.subscribe(
+ "incoming-call",
+ function(message) {
+ output(message);
+ }
+ );
navigator.webChannel.exec(
{a:"This is a request from HTML"},
function(response) {