fork download
  1. function sendMessage(){
  2. console.log("Sending " + JSON.stringify({ 'message' : chatInput.value }));
  3. webSocket.send(JSON.stringify({ 'message' : chatInput.value }));
  4.  
  5. chatInput.value = "";
  6. };
  7. function handleOnMessage(event){
  8. var msg = JSON.parse(event.data);
  9. console.log("Received " + msg.message);
  10. if(msg.message !== null) chatArea.value += msg.username + ": " + msg.message + "\n";
  11.  
  12. }
Success #stdin #stdout 0.01s 10560KB
stdin
Standard input is empty
stdout
Standard output is empty