From cfa401046d2ee1872bfbd16851f010abd837b82e Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Tue, 1 Apr 2014 18:35:31 -0400 Subject: stuff --- www/js/html5ks.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'www/js') 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(); -- cgit v1.2.3-70-g09d2