Advertisement
DesKingMaster

Código de Testes para DoEmail.ino

Jul 17th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1. //ALTERADO PARA TESTES!!!
  2.  
  3. const char *data_update_js_str=" var x = setInterval(function() {\n\
  4.        loadData(\"data.txt\",updateData)\n\
  5.    }, 1000);\n\
  6. \n\
  7. function loadData(url, callback){\n\
  8.    var xhttp = new XMLHttpRequest();\n\
  9. \n\
  10.    xhttp.onreadystatechange = function(){\n\
  11.        if(this.readyState == 4 && this.status == 200){\n\
  12.            callback.apply(xhttp);\n\
  13.        }\n\
  14.    };\n\
  15. \n\
  16.    xhttp.open(\"GET\", url, true);\n\
  17.    xhttp.send();\n\
  18. }\n\
  19. \n\
  20. function updateData(){\n\
  21.        document.getElementById(\"LEDBlink\").onclick = this.responseText;\n\
  22. }\n\
  23. ";
  24. const char *index_html_str="<head>\n\
  25. <script type=\"text/javascript\" src=\"data_update.js\" charset=\"utf-8\"></script>\n\
  26. </head>\n\
  27. <h1>Sensor to Node MCU Web Server</h1><h1>Data:</h1> <h1 id=\"data\">\"\"</h1>\n\
  28. <div id=\"LEDBlink\"><button type=\"button\" onclick=\"data.txt\">Blink</button></div>\n\
  29. ";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement