Cześć wszystkim, gdy próbuję zaczytać XML z linku dostaję taki komunikat: test2.html:1 Access to fetch at 'https://demo1.voxdeveloper.com/webservice/realestatestatuslist/api_key/[ciach]/investment_id/15' from origin 'http://127.0.0.1:5500' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. Nie wiem jak się tego pozbyć. Podsyłam kawałęk kodu:
const url = "https://demo1.voxdeveloper.com/webservice/realestatestatuslist/api_key/[ciach]/investment_id/15";
fetch(url)
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('Error fetching data');
throw new Error('Network response was not ok');
}
})
Z góry dziękuję.