What is a clean and readable way to chain jQuery ajax requests? I am trying to get out of this callback hell. I have ready many posts on this but they don't seem to answer this without even more complexity.
$.get('file1.php')
.done(function(data) {
$.get('file2.php')
.done(function(data) {
$.get('file3.php')
.done(function(data) {
})
.fail(function() {
showError();
})
})
.fail(function() {
showError();
})
})
.fail(function() {
showError();
})