Home > front end >  I ask JS execution order problems
I ask JS execution order problems

Time:05-01

Onsubmit="return check ()", "
Have an idea in the form is submitted to perform two functions recStop () and recUpload (),
Found that, regardless of whether I set the time delay recstop performed, recUpload execution, can control the operation of recstop finished execution recUpload again?
The function check () {
RecStop ();

//recUpload ();
SetTimeout (recUpload (), 6000);
XXX
}

CodePudding user response:

You can put the recUpload incoming to recStop, in recStop recUpload executed after,

CodePudding user response:

With the promise or the second function as arguments to the first is the callback
  • Related