Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Work with Third-Party Libraries | Asynchronous JavaScript and API Integration
Advanced JavaScript Mastery

bookChallenge: Work with Third-Party Libraries

Task

You're building a detailed breed information display. After fetching breed data from the API, you'll display each breed's name, description, life span, male and female weight ranges, and hypoallergenic status.

  1. Use Axios to fetch data from the https://dogapi.dog/api/v2/breeds when the "Fetch Breeds" button is clicked, wrapping the request in a try-catch block.
  2. If there's an error during the API request, hide the loading indicator and display an error message.
index.html

index.html

index.css

index.css

index.js

index.js

copy
  • Use axios.get('https://dogapi.dog/api/v2/breeds') to fetch data from the API;
  • In the catch block, handle the error.
index.html

index.html

index.css

index.css

index.js

index.js

copy

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 4. Luku 9

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Awesome!

Completion rate improved to 2.22

bookChallenge: Work with Third-Party Libraries

Pyyhkäise näyttääksesi valikon

Task

You're building a detailed breed information display. After fetching breed data from the API, you'll display each breed's name, description, life span, male and female weight ranges, and hypoallergenic status.

  1. Use Axios to fetch data from the https://dogapi.dog/api/v2/breeds when the "Fetch Breeds" button is clicked, wrapping the request in a try-catch block.
  2. If there's an error during the API request, hide the loading indicator and display an error message.
index.html

index.html

index.css

index.css

index.js

index.js

copy
  • Use axios.get('https://dogapi.dog/api/v2/breeds') to fetch data from the API;
  • In the catch block, handle the error.
index.html

index.html

index.css

index.css

index.js

index.js

copy

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 4. Luku 9
some-alt