aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-05-04 14:32:49 +0200
committerpiernov <piernov@piernov.org>2016-05-04 14:32:49 +0200
commitec7771705d62d09fcd142c87f4941604f31c1d76 (patch)
tree9dc7d3eb9a51c0c08df0f44ef1613d54623d0a7b
parent3a8e674e0cba99d32cdd012ac9ac593f27c9a35c (diff)
downloadcandybox-ec7771705d62d09fcd142c87f4941604f31c1d76.tar.gz
candybox-ec7771705d62d09fcd142c87f4941604f31c1d76.tar.bz2
candybox-ec7771705d62d09fcd142c87f4941604f31c1d76.tar.xz
candybox-ec7771705d62d09fcd142c87f4941604f31c1d76.zip
Don't send content-type when uploading file + update saves list when loading page
-rw-r--r--js/craftmine.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/craftmine.js b/js/craftmine.js
index 92fa45a..4e6490f 100644
--- a/js/craftmine.js
+++ b/js/craftmine.js
@@ -5,10 +5,10 @@ data = {
level: 1
}
-function sendRequest(url, params, callback) {
+function sendRequest(url, params, callback, isFile) {
var xhr = new XMLHttpRequest();
xhr.open("POST", url);
- xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ if(!isFile) xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if(xhr.readyState == XMLHttpRequest.DONE && xhr.status == "200") {
var data = JSON.parse(xhr.responseText);
@@ -63,5 +63,6 @@ function updateMine() {
function init() {
initCraftMine();
changeTab();
+ listSaves();
window.setInterval(updateMine, 1000);
}