Beginner
Check the Status Before You Read
This route is busy the first time: it answers 429. The second time it answers normally. Right now the page shows the server's raw error JSON as if it were the answer.
Fix the click handler: when the response is not ok, leave #answer empty and show Mitra is busy. Please try again. in #error. When it is ok, show the reply in #answer and clear #error.
What Check tests
- First click (the server answers 429):
#errorshows the message and#answerstays empty - Second click (the server answers normally):
#answershows the reply and#erroris cleared - The raw server error is never shown to the user
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.