input.js socket souble declaration fix

master
louisa 1 year ago
parent 864f74e15f
commit 3a7e360826

@ -1,17 +1,17 @@
var socket = io(); var socket = io();
socket.on('data', function(data){ socket.on('data', function(data){
console.log(data); console.log(data);
document.getElementById('sample').style.opacity = data+"%"; document.getElementById('sample').style.opacity = data + "%";
}); });
socket.on('node5', function(sensor){ socket.on('node5', function(sensor){
console.log(sensor); console.log(sensor);
document.getElementById("file").value = sensor; document.getElementById("file").value = sensor;
if(distance5>0.02 && sensor==50){ if(distance5 > 0.02 && sensor == 50){
alert('u won.'); alert('u won.');
} }
}); });
var form = document.getElementById('form'); var form = document.getElementById('form');
var input = document.getElementById('input'); var input = document.getElementById('input');

Loading…
Cancel
Save