Just dipping my toes into the world of JavaScript, would appreciate any help I can get.
Recently tasked with creating a WordPress website, and as the title indicates, I'm struggling quite a bit with it. Encountering an error message: "SyntaxError: Unexpected token < in JSON at position 0", while using a cors to display properties.
After thoroughly reviewing my code, there don't seem to be any spelling errors. One suggestion was to return "text.json", but that simply displayed the HTML instead.
fetch(corsEnabled)
.then(function(response){
console.log(response);
return response.json();
})
.catch(function(error){
console.log(error);
})