是否可以?这该怎么做?单击按钮时,我调用function1
. 如果条件为真(i==1
),则function1
暂停和以下代码将仅在function2
完全执行后执行。例子:
function1(i){
//some code here
if(i == 1){
function2(i); // call function2 and waits the return to continue
}
//the following code
}
function2(i){
//do something here and returns
}