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訪問即可。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM