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

91
Views
Files in disorder

When I refresh the page I got the questions in disorder - can you help me please?

This is mst files, when I refresh the page sometimes I got the first steps but some times I refresh the pages I can have step 2 or step 5 the files come in disorder and I want the files to be returned in order when I refresh the page.

init() {
    const list = [];
    const $this = this;
    const $files = [
      '/assets/js/template/steps/step_1.mst',
      '/assets/js/template/steps/step_2.mst',
      '/assets/js/template/steps/step_3.mst',
      '/assets/js/template/steps/step_4.mst',
      '/assets/js/template/steps/step_5.mst',
      '/assets/js/template/steps/step_6.mst',
      '/assets/js/template/steps/step_7.mst',
    ];

    $this.addLoading();
    $files.forEach(function (item) {
      list.push(
        fetch(item)
          .then((response) => response.text())
          .then((template) => {
            Mustache.parse(template);
            const output = Mustache.render(template, {});
            document
              .querySelector('.js-simulator-form')
              .insertAdjacentHTML('beforeend', output);
              // console.log(output);
          })
          .catch((error) =>
            console.log('Unable to get the template: ', error.message)
          )
          .finally(function () {
            return true;
          })
      );
      return true;
    });

    Promise.all(list).finally(function () {
      $this.run();
    });
  },
  run() {
    const $this = this;
    const $form = this.$item;
about 4 years ago · Juan Pablo Isaza
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!