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.
use the promise object returned by ajax
var a1 = $.ajax({
url : url,
dataType : 'json',
success : test2
})
.done(cb1)
.done(cb2);
a1.done(cb3);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With