diff options
Diffstat (limited to 'examples/webchannel/standalone/index.html')
-rw-r--r-- | examples/webchannel/standalone/index.html | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/webchannel/standalone/index.html b/examples/webchannel/standalone/index.html index 778a502..cc3d72d 100644 --- a/examples/webchannel/standalone/index.html +++ b/examples/webchannel/standalone/index.html @@ -11,7 +11,10 @@ output.innerHTML = output.innerHTML + message + "\n"; } window.onload = function() { - var baseUrl = (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]); + if (location.search != "") + var baseUrl = (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]); + else + var baseUrl = "ws://localhost:12345"); output("Connecting to WebSocket server at " + baseUrl + "."); var socket = new WebSocket(baseUrl); |