<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
- var dbg;
+ var dbg, errordiv;
var canvas, ctx;
var ww, wh;
var hmax, hfact;
}
function redraw() {
+ errordiv.style.visibility = "hidden";
+ errordiv.innerHTML = "";
clearplot();
if (cold_d.length || hot_d.length) {
tfact = (ww - xzero) / (tmax - tmin);
//dbg.innerHTML = url;
xmlhttp.onreadystatechange = function() {
- if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
- // dbg.innerHTML = xmlhttp.responseText;
- var myData = JSON.parse(xmlhttp.responseText);
- gotdata(myData);
- }
+ if (xmlhttp.readyState == 4)
+ if (xmlhttp.status == 200) {
+ // dbg.innerHTML = xmlhttp.responseText;
+ var myData = JSON.parse(xmlhttp.responseText);
+ gotdata(myData);
+ } else {
+ errordiv.style.visibility = "visible";
+ errordiv.style.display = "block";
+ errordiv.innerHTML = xmlhttp.responseText;
+ }
}
xmlhttp.open("GET", url, true);
clearplot();
var qstr = window.location.search;
dbg = document.getElementById("debug");
+ errordiv = document.getElementById("errormsg");
canvas = document.getElementById("plot");
ctx = canvas.getContext("2d");
resize();
height: 320px;
/* border: solid 1px black; */
}
+div#errormsg {
+ visibility: hidden;
+ color: red;
+ text-align: center;
+}
div#queries {
margin-left: auto;
margin-right: auto;
<br />
<canvas id="plot" width="640" height = "320"></canvas>
<br />
+<div id="errormsg"></div>
+<br />
<div id="totalvals">
Total for the period (l)
<div class="current cold" id="totcold">cold</div>