Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

85
Views
I need an example of calling the same javascript function multiple times sequentially

Good day

I have a call to the same function 9 times. Unfortunately it looks like it runs so fast that a couple of function dont finish or get called

             loadpaymentboxes('1t1', '1h1', p1t1, p1i1);
             loadpaymentboxes('1t2', '1h2', p1t2, p1i2);
             loadpaymentboxes('1t3', '1h3', p1t3, p1i3);

             loadpaymentboxes('2t1', '2h1', p2t1, p2i1);
             loadpaymentboxes('2t2', '2h2', p2t2, p2i2);
             loadpaymentboxes('2t3', '2h3', p2t3, p2i3);

             loadpaymentboxes('3t1', '3h1', p3t1, p3i1);
             loadpaymentboxes('3t2', '3h2', p3t2, p3i2);
             loadpaymentboxes('3t3', '3h3', p3t3, p3i3);

How do you chain these calls so that only after the the previous call has finished, it is allowed to run it again.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This code will execute the functions after one second

var i = 1;
var timer = setInterval(function() {
  if( i >= 9 ) {
    clearInterval( timer );
  }
  //YourFunction();
  console.log(i);
   i++;
}, 1000/*Change this time in milliseconds to modify the execution time between functions*/);

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!