I have this json file I try to read using JS but it returns a syntax error: unexpected token at line 2 ":"
Where could this error come from?
fetch('../json/destinations_data.json')
.then(response => response.text())
.then(data => {
window.alert(data);
console.log(data);
});
{
"user1":{
"email":"[email protected]",
"password":"oss117",
"prenom":"Lucien",
"nom":"Bramare"
},
"user2":{
"email":"[email protected]",
"password":"oss117",
"prenom":"Noël",
"nom":"Flantier"
}
}