-
您的位置:首页 → 网页设计 → ASP实例 → XMLHTTP+Javascript+Asp写得聊天室,无刷新实现(六)
XMLHTTP+Javascript+Asp写得聊天室,无刷新实现(六)
时间:2004/11/7 2:57:00来源:本站整理作者:蓝点我要评论(0)
-
#############续send.asp#################
var oRDom=new ActiveXObject("Microsoft.XMLDOM");
oRDom.async=false;
var Path="reload.asp";
var tCok;
function Clock()
{cRld++;
if (cRld>10){cRld=1;GetXmlData();}
clearTimeout(tCok);
tCok=setTimeout("Clock()",1000);
}
function GetXmlData() //这就是刷新用户XML数据的函数
{cRld=1;
oRDom.load(Path)
if(oRDom.parseError.errorCode != 0)
{alert("Sorry.出现了错误");
return }
else
{
var aryF=oRDom.documentElement.selectNodes("F");
var aryT=oRDom.documentElement.selectNodes("T");
var arysC=oRDom.documentElement.selectNodes("sC");
var arycL=oRDom.documentElement.selectNodes("cL");
var arysJ=oRDom.documentElement.selectNodes("sJ");
var aryE=oRDom.documentElement.selectNodes("E");
var tmpHtml="";
lengt=aryF.length;
for(var i=0;i
img="";
tmpHtml=""+eV[aryE(i).text*2]+rp2(arysC(i).text,"{^amp]","&")+" ["+arysJ(i).text+"]
";
tmpHtml=rp2(tmpHtml,"$F",""+img+aryF(i).text+"");
tmpHtml=rp2(tmpHtml,"$T",""+aryT(i).text+"");
if (aryF(i).text==Me || aryT(i).text==Me)
{ parent.my.Ly.innerHTML+=tmpHtml;
} else
parent.pub.Ly.innerHTML+=tmpHtml;
}
}
delete(aryF);delete(aryT);delete(arysC);delete(arycL);delete(arysJ);
}
function towho(un){
document.say.T.options[0].value=un;
document.say.T.options[0].text=un;
document.say.says.focus();return;}