This seems like it should be simple, but it's proving to be a pain. How do you set the src of an image to a name containing spaces? I tried this way:
var newSrc = "images/" + sname[field].split(":")[selected] + ".png";
document.getElementById("image" + field).src = newSrc;
as well as putting the calculation directly into the space occupied by the newSrc variable. However, the image never displays despite it being displayed on another element, and retrieval via
document.getElementById("image" + field).src
shows it's in fact been set as
http://localhost/SkillPlanner/images/Branch%202.png
Technically, I guess there's two questions:
1) Why is it fully qualifying it when all I need is a relative link?
2) How can I keep the spaces intact as they are part of the filename?