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

168
Views
Text "Progress bar"

I'm a beginner with Javascript and wanted to ad just a little text based fake progress bar to my site.

Here's what i tried:

function progbar(){
    document.getElementById("bar").innerHTML = "Ladevorgang: ";
        for (var i = 0; i<100; i++)
    {
        adprogress();
        sleep(50);
    }
    //document.getElementById("bar").innerHTML = "";
}
function adprogress(){
document.getElementById("bar").innerHTML += "|";
}
function sleep(milliseconds) {
    var start = new Date().getTime();
    for (var i = 0; i < 1e7; i++) {
        if ((new Date().getTime() - start) > milliseconds){
            break;
        }
    }
}

The problem is it doesn't do this:

Ladevorgang:|

Ladevorgang:||

Ladevorgang:|||

Ladevorgang:||||

and so on

it just waits and then shows the complete thing.

Is this just how Javascript works or is there something i dont see?

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!