Page 1 of 1

Wait for Service Complete in JS

Posted: Thu Aug 06, 2015 6:22 pm
by Chris Dillow

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
},
});


Wait for Service Complete in JS

Posted: Fri Aug 07, 2015 4:58 pm
by Serhii Kulibaba

Hello Chris,

The best way is run all services in sequence (or the same, but with different parameters).