I have lots of PNG images added to the project Files folder and I want to check if a file with a specified name exists. I'm currently requesting the file name with AJAX, but it throws an error in console, so I'm looking for another way to do this.
I tried this code, but it returns "No image" even if the image does exist:
var image = new Image();
image.onerror = function() {
console.log("No image");
}
image.src = "1.png";