window.preloadShips = function(){
window.shipImages.omega = new Image();
window.shipImages.omega.src = "shipIcons/omega.png";
}
// After a while
for (var i = 0; i < this.primary.systems.length; i++){
var td = document.createElement("td");
td.className = "iconContainer";
td.appendChild(window.shipImages.omega);
tr.appendChild(td);
}
table.appendChild(tr);
Upon execution, only the TD within the table will hold the image, leaving other TDs empty.
a) What could be causing this behavior?
b) How can this issue be addressed effectively?
- Thank you for your assistance