- 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;
+ }