Konfi-Castle-Kasino/assets/js/load.js

29 lines
660 B
JavaScript

setInterval(function() {
$.getJSON('/list', function (data) {
//console.log(data);
$( "#konfis" ).html('');
$.each( data, function( i, item ) {
$( "#konfis" ).append('<tr> <td>' + item.Name + '</td> <td>' + item.Gemeinde + '</td> <td>' + item.KCoins + '</td></tr>');
});
});
}, 1000);
/*
var loc = window.location;
var uri = 'ws:';
if (loc.protocol === 'https:') {
uri = 'wss:';
}
uri += '//' + loc.host;
uri += loc.pathname + 'ws';
ws = new WebSocket(uri)
ws.onopen = function() {
console.log('Connected');
ws.send('get');
};
ws.onmessage = function(evt) {
console.log(evt.data);
};*/