chrome错误 - Cross origin requests are only supported for protocol schemes: http...

目录

原因是使用ajax请求本地文件,chrome会报跨域错误。

XMLHttpRequest cannot loadfile:///C:/Users/Li/Desktop/images/alist.json.Cross origin requests are only supported for protocol schemes: http, data,chrome-extension, https, chrome-extension-resource.

解决方法:

给chrome添加启动参数:--allow-file-access-from-files

具体方法:

在浏览器快捷方式上右键-属性-快捷方式-目标 如下图:

QQ截图20170405114823.png

文章最后编辑时间为:2017-04-05 14:34:10

标签: 跨域 chrome

声明:本博客如无特殊说明皆为原创,转载请注明来源:chrome错误 - Cross origin requests are only supported for protocol schemes: http...谢谢!

相关文章

精彩评论
  1. Flicker Flicker  Windows 8.1 x64 Edition Google Chrome 50.0.2661.102

    ??
    icon_twisted.png

发表评论:

icon_question.pngicon_razz.pngicon_sad.pngicon_evil.pngicon_exclaim.pngicon_smile.pngicon_redface.pngicon_biggrin.pngicon_surprised.pngicon_eek.pngicon_confused.pngicon_cool.pngicon_lol.pngicon_mad.pngicon_twisted.pngicon_rolleyes.pngicon_wink.pngicon_idea.pngicon_arrow.pngicon_neutral.pngicon_cry.pngicon_mrgreen.png