I have the structure of my project like this:
index.html ---folder js ---file data.json ---file index.js
In the data.json I have some data:
{
"photographers":[
{
"name":"Mimi Keel",
"id":243,
"city":"London",
"country":"UK",
"tags":[
"portrait",
"events",
"travel",
"animals"
],
"tagline":"Voir le beau dans le quotidien",
"price":400,
"portrait":"MimiKeel.jpg"
}]
}
in index.js :
fetch('./data.json',{
headers : {
'Content-Type': 'application/json',
'Accept': 'application/json'
}})
.then((response)=>{
return response.json();
})
.then((data)=>{
console.log(data);
})
I get the error
