function listSaves() { sendRequest("craftmine.php", "op=listSaves", function(ret) { var tmphtml="" for(var i=0; i" + ret[i] + "\n"; } console.log(tmphtml); document.getElementById("listsaves").innerHTML = tmphtml; }); } function getCheckedSave() { var radios = document.getElementsByName('saveRadio'); for (var i = 0, length = radios.length; i < length; i++) { if (radios[i].checked) return radios[i].parentNode.textContent; } return -1; } function loadSave() { sendRequest("craftmine.php", "op=loadSave&filename="+getCheckedSave(), function(ret) { initCraftMine(); }); } function downloadSave() { window.open("craftmine.php?op=downSave&filename="+getCheckedSave(), "_blank"); } function deleteSave() { sendRequest("craftmine.php", "op=deleteSave&filename="+getCheckedSave(), function(ret) { listSaves(); }); } function saveGame() { sendRequest("craftmine.php", "op=saveGame"); } function downGame() { window.open("craftmine.php?op=downSave", "_blank"); }