We have image in D:\img\need.png. We need to know image exist or not.We tried like this:-- It's call error method always
$.ajax({
        url:'http://www.himansuit.com//modiyojana.jpg',
        type:'HEAD',
        error: function(jqXHR, textStatus, errorThrown)
        {
            alert("file does not exist");
            console.log(textStatus); 
             console.log(jqXHR); 
             console.log(errorThrown); 
        },
        success: function()
        {
            alert("file exists do something here");//file exists do something here
        }
    }); 
Please guide me .What wrong in my code .How check file exist or not in my system using ajax call
We got Error this