xmlhttp.,setRequestHeader firefox 中文无法设置

yanasdf789 yanasdf789 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我用jquery ajax 进行数据传递,用setRequestHeader 把数据放到消息头文件中,我在IE 中 无论中文非中文都没问题,但是在Firefox中,如果参数值是中文,debug中调试时,在消息头中看不到添加的值
 $.ajax({
method: "post",
url: url,
async: false,
time: myDate.getTime(),
beforeSend: function (xmlhttp) {
xmlhttp.setRequestHeader('Content-Type', 'application/x-wwww-form-urlencoded;charset=UTF-8');

if (head != null) {
for (value in head) {
var v=head[value];
xmlhttp.setRequestHeader(value, v);
}
}

},
error: function (XHR, textStatus, errorThrown) {
result = "XHR=" + XHR + "\ntextStatus=" + textStatus + "\nerrorThrown=" + errorThrown;
},
success: function (data, textStatus) {
result = data;
}
});
...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
yanasdf789
JavaScript 87,984 成员 224,681 内容