19 lines
516 B
JavaScript
19 lines
516 B
JavaScript
window.onload = function() {
|
|
console.log('window.onload');
|
|
|
|
var play_log = document.getElementById('play-log');
|
|
var last_tag = document.getElementById('last-tag');
|
|
|
|
function updateLog(data) {
|
|
last_tag.innerHTML = data.tag;
|
|
play_log.innerHTML = data.html;
|
|
}
|
|
|
|
var host = window.document.location.host.replace(/:.*/, '');
|
|
var ws = new WebSocket('ws://' + host + ':' + jukebox.port);
|
|
ws.onmessage = function (event) {
|
|
updateLog(JSON.parse(event.data));
|
|
};
|
|
|
|
};
|