Wait for Service Complete in JS
Executing a service in javascript seems to be async.
If you executing a service in a loop say to upload a number of files whats the best way of waiting for the prior execution before starting a new one?
service_name.execute({
success: function( e ) {
//Success handler here
},
error: function( e ) {
//Error handler here
},
complete: function( e ) {
//Complete handler here
},
});