For example:
$.get('/path/to/api').then(
function(data) {
alert( "$.get succeeded" );
}, function(error) {
alert( "$.get failed!" );
}
);
Is it possible to apply the backcall operator on both callbacks?
For example:
$.get('/path/to/api').then(
function(data) {
alert( "$.get succeeded" );
}, function(error) {
alert( "$.get failed!" );
}
);
Is it possible to apply the backcall operator on both callbacks?
You can only use one function with the backcall, but what you can do is use a backcall, and supply the other function normally (note the use of the
_
as a placeholder to denote where the backcall function should go in the arguments) - eg.compiles to: