How do I check if a file on my server exists in jQuery or pure JavaScript?
i used this script to add alternative image
function imgError() { alert('The image could not be loaded.'); }
HTML:
http://wap.w3schools.com/jsref/event_onerror.asp