Pre-release demo version
[ampy.git] / html / index2.php
1 <!DOCTYPE html>
2 <meta charset="UTF-8">
3 <script src='/javascript/jquery/jquery.js'></script>
4
5 <hr>
6 <span id=debugg>
7 </span>
8 <hr>
9
10 Puissance instannĂ©e: <span id=currentpower>Unknown</span> watts<br>
11
12 <script>
13 xhr = new XMLHttpRequest();
14 xhr.onreadystatechange = function() {
15         document.getElementById('debugg').innerHTML += ""+xhr.readyState+"<br>";
16         document.getElementById('debugg').innerHTML += ""+xhr.status+" "+xhr.statusText+"<br>";
17         document.getElementById('debugg').innerHTML += ""+xhr.responseText+"<br>";
18         this.response = "";
19 }
20 xhr.open('GET', 'currentjson_chunked.php', true /*async*/);
21 xhr.send(null);
22
23 //autorefresh_power = 1;
24 //function refresh_power() {
25 //      $.ajax({
26 //              url : 'currentjson_chunked.php',
27 //              success : function(result) {
28 //                      document.getElementById('debugg').innerHTML = document.getElementById('debugg').innerHTML + "success<br>";
29 //                      alert(result);
30 //                      document.getElementById('currentpower').innerHTML = result['watts'];
31 //              },
32 //              complete : function(textStatus) {
33 //                      document.getElementById('debugg').innerHTML = document.getElementById('debugg').innerHTML + "complete<br>";
34 //              //      if (autorefresh_power)
35 //              //              setTimeout("refresh_power()", 1000);
36 //              }
37 //      });
38 //}
39 //refresh_power();
40 </script>
41
42
43 <img src="graph.php">