1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 10:24:26 +01:00

display: improve java script

Signed-off-by: Ralf Ramsauer <ralf@binary-kitchen.de>
This commit is contained in:
Ralf Ramsauer 2018-03-18 17:39:01 +01:00
parent 78a0cc300f
commit 93a34b7755

View File

@ -5,13 +5,14 @@
<script type="text/javascript" src="static/socket.io.slim.js"></script> <script type="text/javascript" src="static/socket.io.slim.js"></script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
$(document).ready(function() { $(document).ready(function() {
var socket = io.connect(location.protocol + '//' + document.domain + ':' + location.port) var socket = io.connect(location.protocol + '//' + document.domain + ':' + location.port);
socket.on('connect', function() { socket.on('connect', function() {
socket.emit('connected'); socket.emit('connected');
}); });
socket.on('status', function(status) { socket.on('status', function(status) {
$('#led').attr('src', status.led) $('#led').attr('src', status.led);
$('#message').html(status.message) $('#message').html(status.message);
}); });
}); });
</script> </script>