fetch("https://myserver.com/data.json")
.then((response) => response.json())
.then((data) => fillSelect(data));
But I get CORS error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://myserver.com/data.json. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
I think the problem is because I run my html page from filesystem and not within a webserver. That's right?
yes
Обсуждают сегодня