Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <style type="text/css">
- .button {
- background-color: #4CAF50; /* Green */
- border: none;
- color: white;
- padding: 15px 32px;
- text-align: center;
- text-decoration: none;
- display: inline-block;
- font-size: 16px;
- }
- </style>
- <body style="background-color: #f9e79f ">
- <center>
- <div>
- <h1>ESP8266 WEBSERVER</h1>
- </center>
- </div>
- <br>
- <div><h2>
- Temp(C): <span id="nahodnecislo">0</span><br><br>
- </h2>
- </div>
- <script>
- setInterval(function()
- {
- getData();
- }, 2000);
- function getData() {
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- document.getElementById("nahodnecislo").innerHTML =
- this.responseText;
- }
- };
- xhttp.open("GET", "adcread", true);
- xhttp.send();
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement