I have a web app which must call the server multiple times. So far, I had a long nested callback chain; but I would like to use jQuery\'s when,then etc
when
then
My way is to apply callback function:
A(function(){ B(function(){ C()})});
where A, B can be written as
function A(callback) $.ajax{ ... success: function(result){ ... if (callback) callback(); } }