diff options
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/html5ks.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/www/js/html5ks.js b/www/js/html5ks.js index 916426c..0a8eff3 100644 --- a/www/js/html5ks.js +++ b/www/js/html5ks.js @@ -209,9 +209,13 @@ window.html5ks = { } else { xhr.open("GET", "json/" + name + ".json"); xhr.onload = function () { - var d = JSON.parse(xhr.responseText); - html5ks.data[name] = d; - deferred.resolve(d); + if (xhr.status === 200) { + var d = JSON.parse(xhr.responseText); + html5ks.data[name] = d; + deferred.resolve(d); + } else { + xhr.onerror(); + } }; xhr.onerror = function () { deferred.reject(); |