zjf-1992

    疑问 ??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

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2021-05-27
  • 2021-11-30
  • 2021-05-16
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-02
  • 2021-06-16
  • 2021-12-29
  • 2022-12-23
  • 2021-05-09
相关资源
相似解决方案