diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/leaflet-soton.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index 0948789..ba5a138 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -1746,8 +1746,12 @@ SELECT * WHERE {\ xhttp.send(options.data); xhttp.onreadystatechange = function() { - if (xhttp.status == 200 && xhttp.readyState == 4) { - callback(JSON.parse(xhttp.responseText), xhttp.responseText); + if (xhttp.readyState === 4) { // loaded + if (xhttp.status === 200) { + callback(JSON.parse(xhttp.responseText), xhttp.responseText); + } else { + callback(null); + } } }; } |