Anders and Briegel in Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 8 години
преди 8 години
преди 8 години
преди 8 години
12345678910111213141516171819202122
  1. var body;
  2. function poll() {
  3. var xhr = new XMLHttpRequest();
  4. xhr.onload=function() {
  5. soft_console.innerHTML = "\n" + xhr.responseText;
  6. };
  7. xhr.onerror = function(e){
  8. soft_console.innerHTML = "\n" + "Lost connection to server";
  9. };
  10. xhr.open("GET", "/state", true);
  11. xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
  12. xhr.send();
  13. }
  14. window.onload = function () {
  15. console.log("booting");
  16. setInterval(poll, 1000);
  17. }