Hello,
I have a folder which contains a number of images. I pull the images as a dynamic image. If the image name isn’t present in the folder, I get a large X. I’d prefer it to be blank if the image file isn’t found. One caveat is that the full image page will be present, so I can’t check if the data variable or path is empty or NULL. Below is my script that I’d essentially like to work. I’m not sure if how to assess the value of the result in a dymanic image.
var path, newPath, result = “”;
var countryID = record.fields[“childid_ne”].substring(0,3);
path = “Somepath" + countryID + “_FLAG.jpg”;
newPath = path.replace(/\/g,”/");
if (path !== “”) {
result += “file:///” + newPath;
}
if (result !== “”)
results.attr(“src”, result);
else results.hide();