From 2371d2d20d038992072f88eb63049bded18ab47f Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 30 Oct 2018 14:30:26 +0300 Subject: SSE: multiple event names --- juick-server/src/main/assets/scripts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'juick-server/src/main/assets') diff --git a/juick-server/src/main/assets/scripts.js b/juick-server/src/main/assets/scripts.js index 95cbe22f..36678f97 100644 --- a/juick-server/src/main/assets/scripts.js +++ b/juick-server/src/main/assets/scripts.js @@ -143,7 +143,7 @@ function initES() { pageTitle = document.title; } }; - es.onmessage = function(msg) { + es.addEventListener("msg", msg => { try { var jsonMsg = JSON.parse(msg.data); console.log('data: ' + msg.data); @@ -154,7 +154,7 @@ function initES() { } catch (err) { console.log(err); } - }; + }); } function wsIncomingReply(msg) { -- cgit v1.2.3