aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-04-24 22:29:27 +0200
committerpiernov <piernov@piernov.org>2016-04-24 22:29:27 +0200
commit9df3524395d661357483bcfcbf8962e57fe9bd6d (patch)
treed2653bdd336922a9cb0be90b18718c664c14b1cc
parent96b345cdd68e0d5f434cd1bd25417e0b9eb62ba6 (diff)
downloadcandybox-9df3524395d661357483bcfcbf8962e57fe9bd6d.tar.gz
candybox-9df3524395d661357483bcfcbf8962e57fe9bd6d.tar.bz2
candybox-9df3524395d661357483bcfcbf8962e57fe9bd6d.tar.xz
candybox-9df3524395d661357483bcfcbf8962e57fe9bd6d.zip
Display error received from server + switch to specified tab on load
-rw-r--r--js/craftmine.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/js/craftmine.js b/js/craftmine.js
index dc4ee9a..66c35fc 100644
--- a/js/craftmine.js
+++ b/js/craftmine.js
@@ -13,6 +13,7 @@ function sendRequest(url, params, callback) {
if(xhr.readyState == XMLHttpRequest.DONE && xhr.status == "200") {
var data = JSON.parse(xhr.responseText);
if(data.error) {
+ showError(data.error);
return;
}
if(callback) callback(data);
@@ -60,5 +61,6 @@ function updateMine() {
function init() {
initCraftMine();
+ changeTab();
window.setInterval(updateMine, 1000);
}