Well, you can't do it if you just use
Code:
window.location.href="pm10/"+loadDate+""
(what's the +"" on the end of that for?? It is doing nothing at all.)
But what you could do is instead load the image file *INTO* an <IMG> tag and then wait for the
onerror event.
So let's say you change your code to:
Code:
window.location.href="showImage.html?"+loadDate;
And then you would have the
showImage.html page try to load the given image into an <img> tag and handle the onerror event from that tag.
It's not too important, but I would have named the images as "YYYYMMDD.png" instead of as "DDMMYYYY". It's easier to sort them and find any that are missing if you do that.
Are you really expecting to have over 2000 images with this naming convention?