jQuery - How to pass multiple callback functions in jQuery ajax

ajax, jquery

Solution

just call both of your function inside one successs function...

 $.ajax({
   url : url,
   dataType : 'json',
   success : function(data){
      test1(data);
      test2(data);
   } 
});

Problem

In JS file have multiple ajax calls,so I would like to call one AJAX call with multiple callback functions.can any one help me how to call multiple AJAX calls.Here is test code, ``` $.ajax({ url : url, dataType : 'json', success : test1(data) }); $.ajax({ url : url, dataType : 'json', success : test2(data) }); ``` It is working fine,can you please help me how we can call both ajax calls in one.

Original source