运行 Update() 时,我收到一条错误消息,指出 map[x] 在“map[x][y] = rawmap[rawmapcount];”处未定义 我不知道为什么?
var currentuser;
var map = new Array(63);
for(x = 0;x < 36;x++) {
map[x] = new Array(35);
}
function Update(login) {
$.post("server.php",{update:1,login:login},function(data) {
if(data == 0) {window.location.href = "WEBSITE";}
else {
var rawdata = data.split("[BRK]");
currentuser = rawdata[0];
var rawmap = rawdata[1].split("|");
var rawmapcount = -1;
var x;
var y;
for(x = 0;x < 64;x++) {
for(y = 0;y < 36;y++) {
rawmapcount++;
map[x][y] = rawmap[rawmapcount];
}
}
}
});
}
Update(1);
//setInterval(function() {Update(0);},500);