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",这个报错 ...
随机推荐
- 【模板】网络流-最大流模板(Dinic)
#include <cstdio> #include <cstring> #include <algorithm> #include <queue> u ...
- BZOJ4036 [HAOI2015]按位或 【minmax容斥 + 期望 + FWT】
题目链接 BZOJ4036 题解 好套路的题啊,,, 我们要求的,实际上是一个集合\(n\)个\(1\)中最晚出现的\(1\)的期望时间 显然\(minmax\)容斥 \[E(max\{S\}) = ...
- loj6436【PKUSC2018】神仙的游戏
$|S| \le 5 \times 10^5$ 题解 这题直接用通配符匹配的套路会错,因为重复部分的$?$可能同时被当做了$0$和$1$ 有长度为$i$的公共前缀后缀等价于有长度为$n-i$的循环节: ...
- Codeforces Round #426 (Div. 2) D 线段树优化dp
D. The Bakery time limit per test 2.5 seconds memory limit per test 256 megabytes input standard inp ...
- (四)关于读文件的结束的判别方法(EOF和feof)以及区别
关于读文件的时候判断文本是否读完的方式一般可以通过EOF,一般宏定义为-1.因为ASCII码中不可能出现-1. 当以文本形式读取文件内容, 读入的字符值等于EOF时, 表示读入的已不是正常的字符而是文 ...
- Qt ------ QPainter 和控件组件的重绘
使用 QPainter 修改 QPaintDevice 的子类,如果 QPaintDevice 的子类也是 QWidget 的子类,比如自定义QWidget子类.QLabel等,需要把 QPainte ...
- extract_by_one 根据二维数组中某字段来提取数组信息,查看有无重复信息
public function tt(){ $param = array( array ( 'hykno' => '2222222-CB', 'tcdk_fid' => '458B6D70 ...
- python基础之02列表/元组/字典/set集合
python中内置的数据类型有列表(list)元组(tuple)字典(directory). 1 list list是一种可变的有序的集合.来看一个list实例: #第一种方法: >>&g ...
- 进化论VS中性突变理论
进化论VS中性突变理论 查尔斯·罗伯特·达尔文(英语:CharlesRobert Darwin,1809年2月12日-1882年4月19日),英国生物学家,其“进化论”被列为19世纪自然科学的三大发现 ...
- 四大开源协议比较:BSD、Apache、GPL、LGPL
sklearn实战-乳腺癌细胞数据挖掘(博客主亲自录制视频教程) https://study.163.com/course/introduction.htm?courseId=1005269003&a ...