Dim varCount,varReq,xmldom
varCount = Request.TotalBytes
varReq = Request.BinaryRead(varCount)
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Set xmldom = Server.CreateObject("MSXML2.DOMDocument")
xmldom.load varReq
Response.Write "<?xml version=""1.0"" encoding=""GB2312""?>" & xmldom.documentElement.xml
Else
Response.Write "<?xml version=""1.0"" encoding=""GB2312""?><a>如何解决XMLHTTP提交过时返回的是乱码,这是从服务器直接返回的文字。</a>"
End If
%>
<script language="javascript">
function postData()
{
var oXmlHttp = new ActiveXObject("Msxml2.XMLHttp");
var sPostString = "aa=bb&cc=中文";
oXmlHttp.open("POST","post.asp",false);
oXmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
oXmlHttp.send(sPostString);