aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/assets
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-30 14:30:26 +0300
committerGravatar Vitaly Takmazov2018-10-30 14:30:26 +0300
commit2371d2d20d038992072f88eb63049bded18ab47f (patch)
tree5494ff683f1604b22dc959c2a26c240ee4df4c1d /juick-server/src/main/assets
parentfff2c3a33de290bc80fd16b9b07c211b441bb268 (diff)
SSE: multiple event names
Diffstat (limited to 'juick-server/src/main/assets')
-rw-r--r--juick-server/src/main/assets/scripts.js4
1 files changed, 2 insertions, 2 deletions
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) {