diff options
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) { |