chrishoadley
11/7/2013 - 5:51 PM

Check to see if image exists on the server.

Check to see if image exists on the server.

function imageExists(image_url){

    var http = new XMLHttpRequest();

    http.open('HEAD', image_url, false);
    http.send();

    return http.status != 404;

}