Попробуйте так:
try{
map = xmlResp.getElementsByTagName('x'+x+'y'+y).item(0).firstChild.data;
if(!map){document.getElementById('x'+x+'y'+y).style.backgroundImage = "url(img/" + map + ")";
}else{
document.getElementById('x'+x+'y'+y).style.backgroundImage = "url(img/no.gif)";
}
}catch(e){
document.getElementById('x'+x+'y'+y).style.backgroundImage = "url(img/no.gif)";
}