Access to XMLHttpRequest at fileCUsersadminDesktoptopuimportJSONhtml from origin null has been blocked by CORS policy Cross origin requests are only supported for protocol schemes http data isolated-a
This error message indicates that the browser is blocking the XMLHttpRequest (XHR) request because it violates the same-origin policy. The same-origin policy is a security feature implemented by web browsers that prevents web pages from making requests to a different domain or protocol than the one that served the original web page.
In this case, it seems that the XHR request is trying to access a file on the local file system (i.e., file:///C:/Users/admin/Desktop/topu/importJSON.html) from an origin that is not allowed by the CORS policy. The allowed origins are listed in the error message, and they include http, https, chrome, chrome-extension, and a few others.
To fix this error, you can try hosting the importJSON.html file on a web server that supports the allowed origin protocols. Alternatively, you can disable the same-origin policy in your browser, but this is not recommended as it can pose a security risk.
原文地址: https://www.cveoy.top/t/topic/bFSn 著作权归作者所有。请勿转载和采集!