js异步XMLhttpPost,并带有,等待显示,防正,XMLhttpPost请求时间过来,而使浏览器死掉!
在使用DHTML进行编程时比较有用,防止浏览器在请求中,死掉
var xml = GenXMLData(tableName, fieldID, "", "");
var content = "<table height=100% width=100%><tr><td><div id='divDoing' style='position:absolute; left:500px; top:136px; width:196px; height:105px; z-index:1;'><div align='center'><p><img src='../Images/doing.gif' width='32' height='32'/></p><p><br/>正在查询、请稍候……</p></div></div></td></tr></table>";
contentTD.innerHTML = content;
var XmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
XmlHttp.onreadystatechange=function(){
if(XmlHttp.readyState==4){
if(XmlHttp.status==200)
{
contentTD.innerHTML = XmlHttp.responseText;
firstPost = true;
}
else
contentTD.innerHTML = content ;
}
}
XmlHttp.open("post",webFile,true);
XmlHttp.send(xml);
var content = "<table height=100% width=100%><tr><td><div id='divDoing' style='position:absolute; left:500px; top:136px; width:196px; height:105px; z-index:1;'><div align='center'><p><img src='../Images/doing.gif' width='32' height='32'/></p><p><br/>正在查询、请稍候……</p></div></div></td></tr></table>";
contentTD.innerHTML = content;
var XmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
XmlHttp.onreadystatechange=function(){
if(XmlHttp.readyState==4){
if(XmlHttp.status==200)
{
contentTD.innerHTML = XmlHttp.responseText;
firstPost = true;
}
else
contentTD.innerHTML = content ;
}
}
XmlHttp.open("post",webFile,true);
XmlHttp.send(xml);