Jquery chain ajax calls

jQuery -- Posted on June 18, 2018

Jquery chain ajax calls

              
                function A(){
  return $.ajax({
      url: url,
      type: type,
      data: data,
      datatype: datatype,
      success: function(data)
      {
        code here
      }
  });
}

function B(){
  return $.ajax({
      url: url,
      type: type,
      data: data,
      datatype: datatype,
      success: function(data)
      {
        code here
      }
  });
}

function C(){
  return $.ajax({
      url: url,
      type: type,
      data: data,
      datatype: datatype,
      success: function(data)
      {
        code here
      }
  });
}

A().done(function(data){
  B().done(function(data){
    C();
  })
})
                  
   
            

Related Posts