YggY
Reactiflux4y ago
29 replies
Ygg

✅ – ✅ – ✅ – Ygg – 21-49 Oct 31

Hello everyone

I'm making a Pokedex using PokeAPI
I'm trying to add
addEventListener('click', ...)
to every Pokémon element so I can use it to open a Modal with the detailed Pokémon info
As I'm fetching info from the API, I'm getting errors. I can't seem to find a way to add those eventListeners after the fetch
I googled it for hours and was reading about callbacks and async/await, but coudn't make it work...
I even tried to use a global "reader" to see if any fetch is completed in the page and managed to console.log every entry after they finish fetch, unsuccesful
The code in Screenshot is pretty much all JS code I have

Any help?
unknown-4.png
unknown-5.png
Was this page helpful?