from origin 'null' has been blocked by CORS policy: Cross origin requests
42,226
The error message says it all. You are apparently accessing the page running this script with a protocol scheme other than the several supported for cross-origin requests. This would happen commonly if you are, say, executing a local file in your browser via the file:// protocol and trying to access some URL on the Internet in your $.getJSON
call.
Author by
index
Updated on July 09, 2022Comments
-
index almost 2 years
This error occurred while calling up JSON. I don't know why this error is happening.
$.getJSON(url, function(data){ console.log(data); });
Error:
Access to XMLHttpRequest at (this is JSON URL) from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
-
index about 5 yearsIt's settled. Thank you!