原因:Chrome不支持本地Ajax请求。

解决:

  右击Chrome浏览器快捷方式,选择“属性”,在“目标”中加上"--allow-file-access-from-files",注意前面有个空格,重启Chrome浏览器便可。

  

如何解决XMLHttpRequest cannot load file:~~~~~~~~~~~. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-res的更多相关文章

  1. jquery读取本地文件,Windows上报错。XMLHttpRequest cannot load xxx. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.k.cors.a.c

    问题: 测试报告,使用本地的json.txt文件,结果文件读取失败,报错如下: XMLHttpRequest cannot load xxx. Cross origin requests are on ...

  2. nodejs报错 XMLHttpRequest cannot load localhost:3000/test_date/. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

    z在请求本地的时候  如果ajax的URL 前面没有http的话 就会报错 jq.js:2 XMLHttpRequest cannot load localhost:3000/test_date/. ...

  3. 【chrome错误】Cross origin requests are only supported for protocol schemes: http, data,chrome-extension, https, chrome-extension-reso

    使用ajax请求本地文件,chrome会报跨域错误. XMLHttpRequest cannot loadfile:///C:/Users/Li/Desktop/images/alist.json.C ...

  4. Cross origin requests are only supported for protocol schemes: http, data, chrome,chrome-extension的问题

    Cross origin requests are only supported for protocol schemes: http, data, chrome,chrome-extension的问 ...

  5. XMLHttpRequest cannot load file:///E:/userdialog.html?_=1465888805734. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-reso

    做前端写静态页面时,采用的是jq easyui框架 在ie与webkit总是加载的时候总是在loading... 而firefox却是正常加载的,总以为是代码写错了, 经过再三的检查以及百度查找,确认 ...

  6. 【Google Chrome】 Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource问题解决

    问题??打开Google Chrome浏览器报错如下: 结论  浏览器出于安全性考虑,默认对跨域访问禁止 解决方法  给浏览器添加启动参数 --allow-file-access-from-files ...

  7. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

    转自:https://www.zhihu.com/question/20948649?sort=created 我最近也遇到这个问题了,用传统的快捷方式加参数并没有用,不知道是不是和chrome版本有 ...

  8. 跨域问题:Cross origin requests are only supported for protocol schemes: http...

    跨域:Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extensi ...

  9. 本地数据访问时出现跨域问题Cross origin requests are only supported for protocol schemes: ……

    从桌面找到Chrome图标,右键属性,快捷方式,起始位置(安装路径) 注:在cmd中访问Program Files文件的方法 %ProgramFiles%=C:\Program Files %Prog ...

随机推荐

  1. Python日志模块logging&JSON

    日志模块的用法 json部分 先开一段测试代码:注意  str可以直接处理字典   eval可以直接将字符串转成字典的形式 dic={'key1':'value1','key2':'value2'} ...

  2. HTML禁止鼠标右键的代码

    禁止鼠标右键,把Demo的图片全都设为表格的背景,表格的大小与图片的大小一样.这样做看起来是一样的,主要是防止鼠标经过图片时会出现另存的按钮.禁止鼠标右键的代码很简单:<script LANGU ...

  3. ado.net调用带参数的sql语句

  4. Sql server 编写99乘法表

    Sql 组织编写语句 declare @one int,@tow int,@str varchar(100),@num intselect @one=1while(@one<=9)beginse ...

  5. TensorFlow模型加载与保存

    我们经常遇到训练时间很长,使用起来就是Weight和Bias.那么如何将训练和测试分开操作呢? TF给出了模型的加载与保存操作,看了网上都是很简单的使用了一下,这里给出一个神经网络的小程序去测试. 本 ...

  6. 关于wordpress中的contact form7和WP Mail SMTP的一些设置

    昨天帮客户解决了这个问题  折腾了好几个小时  下面说下流程 先配置的  wp mail smtp 如果配置完毕后  就可以使用里面配置的邮件   放到contact form7 中的 发件人中 1 ...

  7. 学习笔记:SASS

    SASS: http://www.sass.hk/sass-course.html  SASS 2015-10-10 http://sass.bootcss.com/docs/sass-referen ...

  8. Python函数定义和使用

    函数是一段可以重复多次调用的代码,通过输入的参数值,返回需要的结果.通过使用函数,可以提高代码的重复利用率.本文主要介绍Python函数的定义.调用和函数参数设置方法. 函数的定义 Python函数定 ...

  9. 【原】 The Linux Command Line - Permissions

    id - display user identity chmod - umask -

  10. Reboot-less node fencing in Oracle Clusterware 11g Release 2

    在进行一次RAC的高可用性测试时,当private网卡的网线被拔掉之后,没有出现传说中的有一个节点被CRS强制重启,取而代之的是node2上面的ASM实例和RDBMS实例被关闭:当网线被重新插上时,n ...