IE下Ajax 提交中文乱码问题
发布时间:2020-12-15 20:58:22 所属栏目:百科 来源:网络整理
导读:今天碰到个乱码问题,在IE下post提交中文乱码,firefox下不会 对比两边提交的请求 头信息发现问题出现在Content-Type, IE下是Content-Type application/x-www-form-urlencoded; 而firefox下是Content-Type application/x-www-form-urlencoded; charset=utf-
今天碰到个乱码问题,在IE下post提交中文乱码,firefox下不会 对比两边提交的请求头信息发现问题出现在Content-Type, IE下是Content-Type application/x-www-form-urlencoded; 而firefox下是Content-Type application/x-www-form-urlencoded; charset=utf-8 , IE没有设置charset=utf-8, 简单解决这个问题: 设置全局的Content-Type
$.ajaxSetup({ contentType: "application/x-www-form-urlencoded; charset=utf-8" }); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |