Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.
在设置请求头的时候报这个Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.,是由于需要先打开XMLHttpRequest
var xhr = new XMLHttpRequest();
//打开xhr
xhr.open('GET',url );
//设置请求头,请求头的设置必须在xhr打开之后,并且在send之前
xhr.setRequestHeader('user-sessionid', sessionId);
Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.的更多相关文章
- NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load xxxx错误解决方法
在开发项目的过程中,和后端对接,我们使用是一个成熟的集成很全面的架构JHipster.后端为java spring-boot 前端ts+react,需求是有一个需要在页面里嵌套iframe的需求.然后 ...
- patchUpload.vue?5e29:406 Uncaught (in promise) DOMException: Failed to execute 'readAsArrayBuffer' on 'FileReader': The object is already busy reading Blobs.
patchUpload.vue?5e29:406 Uncaught (in promise) DOMException: Failed to execute 'readAsArrayBuffer' o ...
- vue 运行项目时,Uncaught (in promise) DOMException: Failed to execute 'open' on 'XMLHttpRequest': Invalid URL
npm run dev 运行项目后 验证码显示不出来 并报错 Uncaught (in promise) DOMException: Failed to execute 'open' on 'XML ...
- 配置Chrome启动参数支持本地AJAX请求,解决XMLHttpRequest cannot load file..,Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest':.. 问题
直接将本地的HTML文件拖拽到Chrome浏览器中运行时,发送的AJAX请求本地文件,会报跨域错误: 报错的原因是:Chrome默认不支持本地的AJAX请求! 解决问题的办法是:给Chrome浏览器添 ...
- Uncaught (in promise) DOMException: Failed to execute 'open' on 'XMLHttpRequest': Invalid URL
解决方案:url前面一定要加http://
- mui.min.js:7 Uncaught DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load
mui框架做的微信公众号网页,在上传数据的时候报了这个错,async: true,//将false改为true就可以了 https://blog.csdn.net/liuzp111/article/d ...
- DOMException: Failed to execute 'open' on 'XMLHttpRequest': Invalid URL 未能在“xmlhttpRequest”上执行“open”:无效的URL。
出现这个报错主要是baseurl:http://192.168.*.*/后面的(/)或是请求里面的url:/user/login中前面的(/)有一个漏掉了,导致合成的路径不完整,所以报错:无效的URL
- [HttpException (0x80004005): Failed to Execute URL.]之画蛇添足之痛
最近很悲惨,发布的一个mvc站点,所有的静态内容,如js.css.图片都不能正常加载,服务器给出的响应是一个如下的异常黄页: Server Error in '/ua' Application.Fai ...
- Jpa自定义查询报错(Failed to convert from type [java.lang.Object[]] to type)
Jpa自定义查询报错 问题背景 今天遇到一个奇怪的报错"Failed to convert from type [java.lang.Object[]] to type",这个报错 ...
随机推荐
- Android Emoji兼容包使用详解
Emoji兼容性 我们经常会遇到这样的问题: 给朋友发的emoji表情, 在自己手机上展示是正常的, 但是到朋友手机上, 却没有展示出来, 或者展示出来了, 但是也跟自己手机上展示的不一样. 所以, ...
- 洛谷 P2184 贪婪大陆 解题报告
P2184 贪婪大陆 题目背景 面对蚂蚁们的疯狂进攻,小\(FF\)的\(Tower\) \(defence\)宣告失败--人类被蚂蚁们逼到了\(Greed\) \(Island\)上的一个海湾.现在 ...
- Linux内核分析实验四----
一.用户态.内核态 权限分级——为了系统本身更稳定,使系统不宜崩溃.(并不是所有程序员缩写的代码都很健壮!!) x86 CPU四种不同的执行级别:0(内核态)—3(用户态) 区分方法:CS:EIP(C ...
- uoj50【UR#3】链式反应
题解: 令$a(x)$为破坏死光的$EFG$,$f(x)$为方案的$EGF$:$f(x) = x + \int \ \frac{1}{2} f^2(x) a(x) \ dt$; 注意到$f(0)= ...
- [转]Multivariate Time Series Forecasting with LSTMs in Keras
1. Air Pollution Forecasting In this tutorial, we are going to use the Air Quality dataset. This is ...
- pytorch文档阅读(一)
本章主要针对pytorch0.4.0英文文档的前两节,顺序可能有些不一样: torch torch.Tensor 张量 Tensors Data type CPU tensor GPU tensor ...
- 21天实战caffe笔记_第一天
1 深度学习术语 深度学习常用名词:有监督学习.无监督学习.训练数据集.测试数据集.过拟合.泛化.惩罚值(损失loss); 机器自动学习所需三份数据:训练集(机器学习的样例),验证集(机器学习阶段,用 ...
- tar 命令显示进度条
实现该功能需要安装 pv,然后把需要处理的数据通过管道传给 pv,最后再进行操作. 传给 pv 的目的是为了知道已经处理的数据量大小,同时需要通过 -s 指定总共需要处理的数据量大小. pv 的安装一 ...
- Unity ZTest深度测试 & ZWrite深度写入
Shader深度渲染队列Queue预定义值:Background(1000).Geometry(2000).AlphaTest(2450).Transparent(3000).Overlay(4000 ...
- VLOOKUP函数将一个excel表格的数据匹配到另一个表中
sklearn实战-乳腺癌细胞数据挖掘(博主亲自录制视频) https://study.163.com/course/introduction.htm?courseId=1005269003& ...