diff options
author | piernov <piernov@piernov.org> | 2016-04-24 22:27:33 +0200 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2016-04-24 22:27:33 +0200 |
commit | 5ff6c7051867ed14ecbbc391709f25106c1bef1f (patch) | |
tree | a259394a3ff4620b4e34d80faa4fd1fd511eba7a /js/craftmine.js | |
parent | f2d53d539ee55e1b41cc74368ad5457da6e05cf3 (diff) | |
download | candybox-5ff6c7051867ed14ecbbc391709f25106c1bef1f.tar.gz candybox-5ff6c7051867ed14ecbbc391709f25106c1bef1f.tar.bz2 candybox-5ff6c7051867ed14ecbbc391709f25106c1bef1f.tar.xz candybox-5ff6c7051867ed14ecbbc391709f25106c1bef1f.zip |
Add client side JS shop functions
Diffstat (limited to 'js/craftmine.js')
-rw-r--r-- | js/craftmine.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/js/craftmine.js b/js/craftmine.js index 912d10c..dc4ee9a 100644 --- a/js/craftmine.js +++ b/js/craftmine.js @@ -44,9 +44,10 @@ function withdrawMine() { } function initCraftMine() { - sendRequest("craftmine.php", "op=getCraftMine", function(xhr) { - var ret = xhr; - data.gold = parseInt(ret); // Server's response is a string + sendRequest("craftmine.php", "op=getCraftMine", function(ret) { + data.gold = parseInt(ret.gold); // Server's response is a string + if(ret.shop) displayShop(ret.shop); + displayInventory(ret.inventory); updateData("gold"); }) } |