$(function() {
  var socket = new WebSocket("ws://" + window.location.host + "/");

  socket.onmessage = function(message){
    console.log('got a message: ')
    console.log(message)
  }

});

@@ -90,19 +90,35 @@
 ket.
-on
+addEventListener('
 message
- =
+',
  fun
@@ -196,14 +196,16 @@
 age)%0A  %7D
+);
 %0A%0A%7D);%0A

Use addEventListener rather than onmessage