<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Example</title>
</head>
<body>
<h2>Example</h2>
<div id="target"></div>
<script>
// Bootstrap code
window.jsb = {ws: new WebSocket('ws://' + location.host)};
jsb.ws.onmessage = (evt) => eval(evt.data);
// Debugging to JavaScript console
jsb.debug = true;
// Example-specific code
jsb.render = (t) => {
document.querySelector('#target').innerHTML += t;
document.querySelector('#target').innerHTML += '<BR>';
}
</script>
</body>
</html>