Reputation: 5779
I use javascrip and promise.
I search a way to get return value where xxxx is wrote, is there a way to get it
jQuery.ajax({
success: function(data, status, jqXHR){
const promise = requestUpdated(data.poviderId);
promise.then(function(data_tt) {
return updateAircrafts(data.sspId, data.id); //result
}).then(function() {
//xxxx
transForm.deserialize("#form", data);
}).catch(function(error) {
});
},
error: function (jqXHR, status) {
}
});
Upvotes: 0
Views: 61
Reputation: 357
You need to pass in the argument in order to obtain it. This parameter will be the data that's being returned in the then
statement beforehand:
jQuery.ajax({
success: function(data, status, jqXHR){
const promise = requestUpdated(data.poviderId);
promise.then(function(data_tt) {
return updateAircrafts(data.sspId, data.id); //result
}).then(function(result) {
// console.log(result);
transForm.deserialize("#form", data);
}).catch(function(error) {
});
},
error: function (jqXHR, status) {
}
});
Upvotes: 1