diff options
author | No'am Rosenthal <noam.rosenthal@nokia.com> | 2011-07-14 12:34:16 -0700 |
---|---|---|
committer | No'am Rosenthal <noam.rosenthal@nokia.com> | 2011-07-14 12:34:16 -0700 |
commit | 1791a4f5a22bac23dfe49f571a3a8886890f40ee (patch) | |
tree | c257ff785d2823e0086979b2d04b65c909d7d4d5 /examples/qmlapp/index.html | |
parent | 308583ae677a8123bb9e90268e510c814e9753cd (diff) | |
download | qtwebchannel-1791a4f5a22bac23dfe49f571a3a8886890f40ee.tar.gz |
move the invoking JS to the server side
Diffstat (limited to 'examples/qmlapp/index.html')
-rw-r--r-- | examples/qmlapp/index.html | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/qmlapp/index.html b/examples/qmlapp/index.html index b6a7aa9..e5830b3 100644 --- a/examples/qmlapp/index.html +++ b/examples/qmlapp/index.html @@ -1,7 +1,17 @@ <html> <head> - <script src="../../src/qwebchannel.js"></script> <script> + function getWebChannelBaseUrl() { + var query = window.location.search.substring(1); + var vars = query.split("&"); + for (var i=0;i<vars.length;i++) { + var pair = vars[i].split("="); + if (pair[0] == "webChannelBaseUrl") + return pair[1]; + } + } + document.write('<script src="' + getWebChannelBaseUrl() + '"><' + '/script>'); + window.onload = function() { var textArea = document.querySelector("textarea"); function output(x) { |