lbry.tech/public/scripts/sockets.js

18 lines
276 B
JavaScript
Raw Normal View History

2018-07-12 23:07:16 +02:00
/* global ws, $ */ "use strict";
ws.onmessage = socket => {
const data = JSON.parse(socket.data);
switch (true) {
case data.message === "updated html":
$(data.selector).html(data.html);
break;
default:
console.log(data);
break;
}
};