I need to recreate a simple product details page, using an API. It's not something I have ever done so I am struggling a bit.
I have managed to fetch the API but I can't figure out how to extract the data I need for the browser. I have been watching YouTube videos but I can't seem to come right.
this is my call to the API, honestly not even sure if this is correct, the data does show up in my console.
*fetch("https://fe-assignment.vaimo.net/").then((data) => {
// console.log(data);
return data.json();
}).then((completedata) => {
console.log(completedata);
}).catch((err) => {
console.log(err)
});*
then for example I want to be able to access the image:
*<img class="drone" src=`${product.gallery[0]}`>*
but I am just getting errors.
If anyone can able point me to some documentation or tutorials I would be incredibly great fall
Are you using any framework or pure javascript? Jquery? If pure javaScript, you have to get the img class="drone" and append your images there. if you are using any framework, then the solution might be different.