fxx
fxx
侠客
侠客
  • 最后登录2020-11-27
  • 发帖数20
阅读:7146回复:0

[nodejs]关于cross origin requests are only supported for protocol schemes :http.......报错

楼主#
更多 发布于:2018-07-17 12:45
这是一个关于ajax本地跨域问题:cross origin requests are only supported for protocol schemes :http,data,chorme,chorme-extension,https.

图片:bug.png


解决方法如下:
一:直接更改chrome的设置就行。 在chrome属性设置中,添加启动参数:--allow-file-access-from-files : 允许本地Ajax请求,也叫file协议下的Ajax请求 。

图片:goole.png





二:找到谷歌浏览器chrome.exe安装路径复制下来我的是"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ,然后打开cmd,直接输入命令"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files
更多解决方法参考:https://stackoverflow.com/questions/10752055/cross-origin-requests-are-only-supported-for-http-error-when-loading-a-local/23758738#23758738
[fxx于2018-07-17 14:17编辑了帖子]
游客


返回顶部

公众号

公众号