开发者

What am I doing wrong with these callbacks?

开发者 https://www.devze.com 2023-03-02 01:17 出处:网络
//trigger fMain(fAfter1()); 开发者_StackOverflow社区 function fMain(callback()){ //do stuff here and then...
//trigger
fMain(fAfter1());
开发者_StackOverflow社区
function fMain(callback()){
    //do stuff here and then...
    callback();
}

function fAfter1(){

}

function fAfter2(){

}

It seems that the callback isn't waiting to be triggered like I hoped it would.

Thanks!


The definition should be function fMain(callback){, not function fMain(callback()){ -- I'm not sure if that's what's causing your problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消