开发者

What am I doing wrong with these callbacks?

//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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜