52,797
社区成员
发帖
与我相关
我的任务
分享
var xmlHttp;
function createXmlHttpRequest()
{
if(window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest();
if(xmlHttp.overrideMimeType)
{
xmlHttp.overrideMimeType("text/xml");
}
}
else if(window.ActiveXObject)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
if(!xmlHttp)
{
window.alert("你的浏览器不支持创建XMLhttpRequest对象");
}
return xmlHttp;
}
function postdata(msg,url,data)
{
createXmlHttpRequest();
xmlHttp.open("post", url, true);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.onreadystatechange=callbackpassagain;
xmlHttp.send(data);
}