fancy
fancy

Reputation: 51383

What am I doing wrong with these callbacks?

//trigger
fMain(fAfter1());

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!

Upvotes: 1

Views: 50

Answers (1)

Mike Scott
Mike Scott

Reputation: 4795

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

Upvotes: 4

Related Questions