Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///xxx.txt. (Reason: CORS request not http).

原因:

浏览器不支持本地直接访问本地硬盘上的文件。

 

详细解释:

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

 

解决方法:

用tomcat,apache等发布文件(网站),http访问即可。

posted @ 2020-12-01 09:29  emanlee  阅读(2173)  评论(0编辑  收藏  举报