我想用ajax进行无刷新的表单提交,但是我的setRequestHeader好像没起作用
代码:
var url = "ajaxpage/form.php";
xmlHttp.open("POST",url,false);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset =gb2312");
xmlHttp.send(datastr);
这是requesthead的情况
然后我改了一下写法 将application/x-www-form-urlencoded;不要了之后就显示charset是gb2312,但是这样就没法post表单了 请问如何解决?