Reputation: 75
I have come to a time in my java-script adventure where I have needed to nest callbacks. I have the following code. I keep reading bout nested callbacks being hell... if someone could explain or help with the code. I am still very new to asynchronous programming. I am using nodejs
, express 3.0
, jade
, node-mysql
db_helper.getCategory(function (category) {
db_helper.getCities(function (cities) {
res.render('/search', category: category, cities: cities });
});
});
i apologize for not really asking. Im wondering if this is ok to do this? Whats a better way to handle nested callbacks?
Upvotes: 0
Views: 443