From 9df3524395d661357483bcfcbf8962e57fe9bd6d Mon Sep 17 00:00:00 2001 From: piernov Date: Sun, 24 Apr 2016 22:29:27 +0200 Subject: Display error received from server + switch to specified tab on load --- js/craftmine.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js') 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); } -- cgit v1.2.3-70-g09d2