concept callback hell in category javascript
appears as: callback hell

This is an excerpt from Manning's book JavaScript Application Design: A Build First Approach.
We established what callback hell is, and you learned how to stay away from it by naming your functions or composing your own flow control methods.
Callback hell doesn’t happen overnight, and you can prevent it from ever happening. Using an example (named ch06/01_callback-hell in the samples), let’s see how it might slowly creep through the cracks of your code base over time. Suppose you have to make an AJAX request to fetch data, and then show that to a human. You’ll use an imaginary http object to simplify the AJAX-foo. Let’s also assume you have a record variable holding a reference to a particular DOM element.