diff options
-rw-r--r-- | lib/js/urweb.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 9dd4dbbe..bfca94a4 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -133,8 +133,19 @@ function rc(uri, k) { var xhr = getXHR(); xhr.onreadystatechange = function() { - if (xhr.readyState == 4) - k(xhr.responseText); + if (xhr.readyState == 4) { + var isok = false; + + try { + if (xhr.status == 200) + isok = true; + } catch (e) { } + + if (isok) + k(xhr.responseText); + else + alert("Error querying remote server!"); + } }; xhr.open("GET", uri, true); |