1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Update to 18.06

This commit is contained in:
Ycarus 2018-07-31 17:18:00 +02:00
parent ce9432d93b
commit 110470cb85
50 changed files with 335 additions and 367 deletions

View file

@ -65,12 +65,8 @@ XHR = function()
if (xhr.readyState == 4) {
var json = null;
if (xhr.getResponseHeader("Content-Type") == "application/json") {
try {
json = JSON.parse(xhr.responseText);
}
catch(e) {
json = null;
}
try { json = JSON.parse(xhr.responseText); }
catch(e) { json = null; }
}
callback(xhr, json, Date.now() - ts);
@ -90,8 +86,15 @@ XHR = function()
xhr.onreadystatechange = function()
{
if (xhr.readyState == 4)
callback(xhr, null, Date.now() - ts);
if (xhr.readyState == 4) {
var json = null;
if (xhr.getResponseHeader("Content-Type") == "application/json") {
try { json = JSON.parse(xhr.responseText); }
catch(e) { json = null; }
}
callback(xhr, json, Date.now() - ts);
}
}
xhr.open('POST', url, true);