diff options
author | piernov <piernov@piernov.org> | 2016-04-24 22:23:04 +0200 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2016-04-24 22:23:04 +0200 |
commit | 7f345404a79e6e0f25bafa6f25c8ba1edf6aef73 (patch) | |
tree | e98e36b0382ce443e0cf5fae1e81240ffa4afd99 /js | |
parent | bd688fc969dfdda43e180db17095733d6f63da56 (diff) | |
download | candybox-7f345404a79e6e0f25bafa6f25c8ba1edf6aef73.tar.gz candybox-7f345404a79e6e0f25bafa6f25c8ba1edf6aef73.tar.bz2 candybox-7f345404a79e6e0f25bafa6f25c8ba1edf6aef73.tar.xz candybox-7f345404a79e6e0f25bafa6f25c8ba1edf6aef73.zip |
Add JS debitAccount() helper
Diffstat (limited to 'js')
-rw-r--r-- | js/craftmine.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/js/craftmine.js b/js/craftmine.js index bbb1074..46c726a 100644 --- a/js/craftmine.js +++ b/js/craftmine.js @@ -24,6 +24,11 @@ function updateData() { } } +function debitAccount(amount) { + data.gold -= amount; + updateData("gold"); +} + function withdrawMine() { sendRequest("craftmine.php", "op=withdrawMine&amount="+data.mine, function(xhr) { var gold = parseInt(xhr.responseText); // Server's response is a string |