summaryrefslogtreecommitdiff
path: root/examples/webchannel/standalone/index.html
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2017-08-28 16:31:05 +0200
committerKai Koehne <kai.koehne@qt.io>2017-09-08 15:31:30 +0000
commitdd04d74769e1859d571de7c4f2e88cb85a227ab9 (patch)
treeeac49cc7c3b3cb0b2f47c0d0bccf4d1888fb4649 /examples/webchannel/standalone/index.html
parent13294ce605751babad0687e63c033436d129e3d2 (diff)
downloadqtwebchannel-dd04d74769e1859d571de7c4f2e88cb85a227ab9.tar.gz
Examples: beautify JavaScript snippets
Change-Id: I3499bfa49e79ed3664d020f7de0e691afeb15a86 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Diffstat (limited to 'examples/webchannel/standalone/index.html')
-rw-r--r--examples/webchannel/standalone/index.html12
1 files changed, 4 insertions, 8 deletions
diff --git a/examples/webchannel/standalone/index.html b/examples/webchannel/standalone/index.html
index a41bbbe..7c042cd 100644
--- a/examples/webchannel/standalone/index.html
+++ b/examples/webchannel/standalone/index.html
@@ -5,8 +5,7 @@
<script type="text/javascript" src="./qwebchannel.js"></script>
<script type="text/javascript">
//BEGIN SETUP
- function output(message)
- {
+ function output(message) {
var output = document.getElementById("output");
output.innerHTML = output.innerHTML + message + "\n";
}
@@ -19,16 +18,13 @@
output("Connecting to WebSocket server at " + baseUrl + ".");
var socket = new WebSocket(baseUrl);
- socket.onclose = function()
- {
+ socket.onclose = function() {
console.error("web channel closed");
};
- socket.onerror = function(error)
- {
+ socket.onerror = function(error) {
console.error("web channel error: " + error);
};
- socket.onopen = function()
- {
+ socket.onopen = function() {
output("WebSocket connected, setting up QWebChannel.");
new QWebChannel(socket, function(channel) {
// make core object accessible globally