JavaScript Create a Reusable Fetch Function

Jerome vanGaalen
Jerome vanGaalen
18,789 Points

Only first image loads.

When I refresh or load the page the first random image appears, but if I click the card, or try to select a breed, I get a broken image on the page and an error 4404 not found message in the console.

1 Answer

Jennifer Nordell
Jennifer Nordell
Treehouse Teacher

Hi there, Jerome vanGaalen! You're doing well, and this all comes down to some punctuation. On line 44 of app.js you are using single quotes where you should be using backticks. So instead of it looking for the breed you selected it's literally searching for ${breed} instead of say Labrador.

Line 44 of app.js right now:


But that should be:

// note the backticks instead of single quotes

Hope this helps! :sparkles: