what i need to do is just say, but (for me) itβs hard to do:
using javascript , given the name of the image, that is, "image01.jpg", I need to check if this image exists in a specific folder or path (local or on the Internet). If the image does not exist in this folder, I need to check if the same image exists in another folder.
e.g. with pseudo code
imageToFind = 'image01.jpg' path1 = 'users/john/images' path2 = 'users/mike/img' if path1+'/'+imageToFind exists //do something else if path2+'/'+imageToFind exists //do something else print('NOT FOUND')
What approach do you suggest? I tried to achieve this using ajax first and then using javascript Image (), but I was not able to complete both of these cases.
Thanks in advance for any help, best regards
source share