【chrome错误】Cross origin requests are only supported for protocol schemes: http, data,chrome-extension
生活随笔
收集整理的這篇文章主要介紹了
【chrome错误】Cross origin requests are only supported for protocol schemes: http, data,chrome-extension
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
使用ajax請(qǐng)求本地文件,chrome會(huì)報(bào)跨域錯(cuò)誤: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添加啟動(dòng)參數(shù):--allow-file-access-from-files。
具體方法:
在瀏覽器快捷方式上右鍵-屬性-快捷方式-目標(biāo) 如下圖:
總結(jié)
以上是生活随笔為你收集整理的【chrome错误】Cross origin requests are only supported for protocol schemes: http, data,chrome-extension的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: rdb转为rdf
- 下一篇: neo4j在linux下的安装