javascript - Nested Callbacks with NodeJS & MySQL -


i have come time in java-script adventure have needed nest callbacks. have following code. keep reading bout nested callbacks being hell... if explain or code. still new asynchronous programming. 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 not asking. im wondering if ok this? whats better way handle nested callbacks?

take @ async npm module. helps organizing callbacks , avoiding deep nesting referring to. perhaps waterfall help.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -