diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2014-04-01 18:35:31 -0400 |
---|---|---|
committer | Alex Xu <alex_y_xu@yahoo.ca> | 2014-04-01 18:35:31 -0400 |
commit | cfa401046d2ee1872bfbd16851f010abd837b82e (patch) | |
tree | 7c354b50acc050f92a460c4d4382d2630a372393 /www/js | |
parent | ec0e4dfd6cc67d5b948fdd0bf419866271f04b44 (diff) | |
download | html5ks-cfa401046d2ee1872bfbd16851f010abd837b82e.tar.xz html5ks-cfa401046d2ee1872bfbd16851f010abd837b82e.zip |
stuff
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(); |