static S subBot_html_webSocketBasedLogView() { ret loadJQuery() + hpre("", id := 'logView) + hreconnectingWebSockets() + hjs_htmlencode() + hjavascript([[ var ws = new ReconnectingWebSocket("${URI}"); ws.onmessage = function(event) { var d = event.data; if (d == "clear") $("#logView").html(""); else { $("#logView").append(htmlencode(d.substring(1))); window.scrollBy(0, 1000000); // keeps X coordinate } }; ]].replace("${URI}", subBot_myWebSocketURI()); }