Intermediate
Time Limit and Try Again
The first request to this route takes 600 ms; later ones are instant. Add a time limit of 200 ms with AbortSignal.timeout(200). When it fires, show Mitra is taking too long. Please try again. in #error and show the #retry button (it starts hidden). Other failures show Cannot reach Mitra. Check your connection.
Clicking #retry asks again. On success show the answer in #answer, clear #error and hide #retry again.
What Check tests
- The first (slow) request ends with
Mitra is taking too long. Please try again.and a visible#retry - Clicking
#retryshows the answer, clears the error and hides#retry - The code uses
AbortSignal.timeout
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.