+ function sendcommand() {
+ let xhr = new XMLHttpRequest();
+ cmd = JSON.stringify(comando.value);
+ xhr.open('GET', '/sendcommand?cmd=' + cmd, true);
+ xhr.onload = function() {
+ if (xhr.status == 200) { //can use this.status instead
+ //console.log(xhr.responseText);// para ver en la consola
+ console.log("command sended is "+cmd);
+ }
+ }
+ xhr.send();
+
+ }