[英]sending a charset in the Content-Type header
i use jquery $ajax to post a contact form to my email. 我使用jquery $ ajax将联系表单发布到我的电子邮件中。
but encoding is wrong and i see question marks. 但是编码是错误的,我看到了问号。
i figured i should set the content-type but cant manage to do so. 我认为我应该设置内容类型,但无法做到这一点。
am using asp 正在使用asp
thx 谢谢
We can set encoding by contentType and mimeType 我们可以通过contentType和mimeType设置编码
jQuery.ajax({
url: "/send_email.html",
data: data,
dataType: 'html', // or json
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
mimeType: 'text/html; charset=UTF-8',
success: function(return_data){
// check return_data if everything is ok
}
});
Reference: http://api.jquery.com/jquery.ajax/ 参考: http : //api.jquery.com/jquery.ajax/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.