lbry.tech/public/scripts/sockets.js
ポール ウェッブ 754b92fc08 GitHub feed is working
2018-07-12 16:47:37 -05:00

17 lines
276 B
JavaScript

/* 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;
}
};