0

I have an ajax call(call 2) inside another ajax success function(call 1). Also i have an ajaxstart function which shows a loading image. But the problem is ajaxstart function is not working on the second ajax call(call 2)

$.ajax({
    type: "POST",
    url: url,
    data: objParam,
    dataType: 'json',
    success: function(result) {
        $.ajax({
            type: "POST",
            url: url,
            data: objParam,
            dataType: 'json',
            success: function(result) {                     
            },     
            error: function(err) {
                alert("Please Try again");
            }
        });
    }, 
    error: function(err) {
        alert("Please Try again");
    }
});
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
Madhu
  • 132
  • 3
  • 10

1 Answers1

1

If $.ajax or $.ajaxSetup is called with the global option set to false the $.ajaxStart () method will not fire

Try global:false inside $.ajax. It will work.