JavaScript · Exercise 5 of 5 Previous
Intermediate
A dashboard that loads in parallel
Three fake servers are given: getUser() (200 ms), getOrders() (300 ms) and getWeather() (fails after 250 ms). Don't change them.
Write loadDashboard() so that clicking Load: disables the button and sets #status to Loading…; loads all three at the same time; shows Hello, Asha in #user, 3 orders in #orders, and the weather in #weather, or Unavailable if that request failed; then sets #status to Done and enables the button again.
One failure must not stop the other parts from showing, and nothing should end up as an uncaught error.
What Check tests
- Clicking Load disables the button and shows
Loading… - All three load in parallel (done within 450 ms)
- Shows
Hello, Ashaand3 orders - The failed weather request shows
Unavailable - The button works again after loading
- No uncaught errors
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.