Intermediate
Show Download Progress
Clicking #download fetches a pretend model file. While it downloads, keep #bar (a <progress> with max="100") and #pct (text such as 40%) up to date from the bytes received and the Content-Length header. When it ends, put Ready in #status.
Clicking #download-bad fetches a file that does not exist. Show Could not download the model (HTTP 404) in #error and do not touch the bar.
What Check tests
- Before any click,
#pctsays0% - While downloading,
#baris above 0 and below 100 - At the end
#baris 100,#pctsays100%and#statussaysReady - A missing file shows the error and no
Ready
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.