报错如下:Cross origin requests are only supported for protocol schemes: http, data,chrome-extension, https, chrome-extension-resource.

ajax跨域请求报错Cross origin requests are only supported for protocol schemes: http, data, chrome, ch

以上错误提示是由于AJAX方法涉及到 跨域 的问题导致!

由于没有在服务器环境里运行含有ajax方法的页面,而是直接通过浏览器打开(类似file:///的访问形式,即file协议)

解决方法:
在win+r里打开cmd输入下面的指令(前提是你配置了环境变量,不然找不到
C:\Users\Administrator> start chrome.exe --disable-web-security --user-data-dir="E:/aaa"


相关文章:

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