Wednesday 31 July 2019

javascript - from origin 'null' has been blocked by CORS policy: Cross origin requests

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.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...