function hireMiner(){ sendRequest("craftmine.php", "op=hireMiner", function() { //datas.gold -= parseInt(datas.mine); var ret = xhr.responseText; console.log(ret); //datas.gold = ret; //updateDatas("gold"); //updateDatas("miners"); }) } function createGuild(){ sendRequest("craftmine.php", "op=createGuild", function() { var ret = xhr.responseText; console.log(ret); }) }