for (i=1; i<=4; i++) {
try {
timer = document.getElementById("timer"+i).parentNode.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[0].className;
}
catch(e) {
FM_log("aguardaReforcos()", "ERRO - timer"+i);
}
...
I have to it this way with try because otherwise I get a crash when it doesn´t find document.getElementById("timer"+i).parentNode.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[0].className
is there another way of preventing this type of crash?