diff options
author | Andrew Dolgov <[email protected]> | 2018-05-20 19:25:38 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-05-20 19:25:38 +0300 |
commit | 22b94bcc3463366c8ad27c33272fe4594a69dc69 (patch) | |
tree | 5447a856332094062974e3bd0a48c153426e45a7 /read.html | |
parent | c85f98198a09d4da999e671cd697d8fef1c16520 (diff) |
mention the reason for resource loader; check for response statuses
Diffstat (limited to 'read.html')
-rw-r--r-- | read.html | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -259,6 +259,8 @@ } $(document).ready(function() { + // we need to preload resources for reader iframe because it can't utilize our + // service worker because while offline it is created outside our base server context var res_names = [ "lib/bootstrap/v3/js/jquery.js", "lib/jquery.mobile.custom.js", "css/transitions.css", "js/reader.js", "css/reader.css", "js/dict.js", @@ -266,7 +268,7 @@ for (var i = 0; i < res_names.length; i++) { fetch(res_names[i], {credentials: 'same-origin'}).then(function(resp) { - resp.text().then(function(data) { + if (resp.status == 200) resp.text().then(function(data) { _res_data[resp.url] = data; }); }); |