Answers for "how to add loader in ajax call"

1

jquery ajax add loading

var $loading = $('#loadingDiv').hide();
$(document)
  .ajaxStart(function () {
    $loading.show();
  })
  .ajaxStop(function () {
    $loading.hide();
  });
Posted by: Guest on December-01-2020
0

display loader on ajax call

$.ajax({
  url        : url,
  cache      : false,
  beforeSend : function(){
    $('#loading-image').show();
  },
  success: function(html){
    $('#loading-image').hide();
    $('.info').append(html);
  },
});
Posted by: Guest on September-23-2021

Browse Popular Code Answers by Language