!7
html {
ret htitle("Live Webs Count")
+ hfullcenter("Live webs count:
"
+ hloadjquery()
+ hdiv("bla
", id := "bla", style := "font-size: 40px")
+ hreconnectingWebSockets()
+ hjavascript([[
var ws = new ReconnectingWebSocket("ws://smartbot.botcompany.de/");
ws.onopen = function(event) {
//ws.send("Here is an important message!");
ws.send("stream-big-number");
$("#bla").append("Streaming...
");
};
ws.onmessage = function(event) {
$("#bla").html(event.data);
document.title = event.data;
};
]]));
}