Attempting to retrieve content using XMLHttpRequest
:
var url = 'http://mapy.geoportal.gov.pl/wss/service/SLN/guest/sln/woj.json'
if (XMLHttpRequest) {
var request = new XMLHttpRequest();
if ('withCredentials' in request) {
request.open('GET', url, true);
request.withCredentials = 'true';
request.withCredentials = 'true';
request.setRequestHeader('Access-Control-Allow-Origin', '*');
request.send();
}
}
Encountering the following error message:
XMLHttpRequest cannot load . Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
How can this issue be resolved? I've already set the Access-Control-Allow-Origin
header to *
Continuing my troubleshooting with URL: jsonp continue