Javascript to wait the end of a function including asynchronous MYSQL Queries from node.js? -
i'm having javascript problem wait function done before below line called. previous function including javascript mysql queries calls (one of library of node.js). looks like:
function first() { /** * lot processes execute * including asynchronous processes * running queries using javascript mysql library node.js */ console.log("i first one!"); } first(); console.log("i second one!");
then when execute this, happening like:
i second one! first one!
how make them run keeping queue order?
note: confusing question, please jump/follow newly created question again:
everyone please follow/jump new question: node.js mysql detect insert/update completeness of query?
pass callback 2nd function call 1st function. @ end of 1st function, invoke theh callback:
function one(parm, callback) { // callback(); } function two() { // else } one("my parm", two);
Comments
Post a Comment