I have an ajax loader gif that should be shown before the ajax call is triggered and hidden on ajax complete, however the element is not showing up.
If I debug using inspect and run step by step the element is shown.
$("#ajaxLoader").show();
$('.spn-invalid-zip').hide();
$("#txtZipCode").removeClass("input-validation-error-style");
if ($("#inValidZipCode").length <= 0) {
$($('#txtZipCode').parent()).append("<span id='inValidZipCode' class='spn-invalid-zip input-validation-error-style'></span>");
}
var valZipCode = value;
if (valZipCode.length < 5) {
resetCountyFields();
return false;
}
var zipCodeResult = false;
$.ajax({
url: path,
type: "POST",
data: { zipcode: valZipCode },
async: false,
success: function (data) {
....
},
complete: function () {
$("#ajaxLoader").hide();
}
});