Top

【Google Chrome】 Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource问题解决

    疑问 ??Google Chrome浏览器打开本地html文件报错如下

原因  浏览器为了安全性考虑,默认对跨域访问禁止

    解决方法

 方案一、 Google Chrome应用程序目标位置中添加  chrome.exe --allow-file-access-from-files  

! 注意中间空格(chrome.exe  --allow-file-access-from-files)

注意!!!   必须重新启动电脑,否则无效......若方案一还无效,继续执行方案二

方案二、 使用cmd命令 传入浏览器启动参数 --allow-file-access-from-files

第三步 用启动浏览器打开html文件即可. 若还出现上述问题,重启电脑,继续方案二

作者:Avenstar

出处:http://www.cnblogs.com/zjf-1992/p/6168751.html

关于作者:专注于前端开发

本文版权归作者所有,转载请标明原文链接

【参考资料】 https://stackoverflow.com/questions/10752055/cross-origin-requests-are-only-supported-for-http-error-when-loading-a-local/23758738#23758738

posted @ 2016-12-13 10:37  Avenstar  阅读(29809)  评论(10编辑  收藏  举报