jquery check local fil echange withou callback code example
Example 1: javascript check if file exists on server
function doesFileExist(urlToFile) {
var xhr = new XMLHttpRequest();
xhr.open('HEAD', urlToFile, false);
xhr.send();
if (xhr.status == "404") {
return false;
} else {
return true;
}
}
Example 2: loading page for all ajax call in jquery 3.3.1
$(document).ajaxStart(function () {
$('#ajax-loading-image').css("display", "block");
});
$(document).ajaxStop(function () {
$('#ajax-loading-image').css("display", "none");
});