function sub()
{
var dx=document.getElementById("dx").value;
if(dx=="" || dx=="全体伙伴")
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
var nr=document.getElementById("txt").value;
if(nr=="")
{
return alert('---<-请输入内容->---');
}
else
{
xmlhttp.onreadystatechange=stateChange;
xmlhttp.open("POST","Default5.aspx?nr="+escape(nr),true);
xmlhttp.send(null);
document.getElementById("txt").value="";
}
}
else if(dx!="" || dx!="全体对象")
{
var qq=document.getElementById("qq");
var sl=document.getElementById("sl");
sl.value=true;
qq.value=true;
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
var nr2=document.getElementById("txt").value;
if(nr2=="")
{
return alert('---<-请输入内容->---');
}
else
{
xmlhttp.onreadystatechange=stateChange2;
xmlhttp.open("POST","Default5.aspx?nr="+escape(nr2),true);
xmlhttp.send(null);
document.getElementById("txt").value="";
}
}
}
function stateChange()
{
var va=document.getElementById("div_chat");
if(xmlhttp.readystate==4 && xmlhttp.status==200)
{
document.getElementById("div_chat").innerText+=xmlhttp.responseText;
}
va.scrollTop=va.scrollHeight;
}这个是我的聊天信息发送如何更改判断其两秒钟发一句话。
{
var dx=document.getElementById("dx").value;
if(dx=="" || dx=="全体伙伴")
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
var nr=document.getElementById("txt").value;
if(nr=="")
{
return alert('---<-请输入内容->---');
}
else
{
xmlhttp.onreadystatechange=stateChange;
xmlhttp.open("POST","Default5.aspx?nr="+escape(nr),true);
xmlhttp.send(null);
document.getElementById("txt").value="";
}
}
else if(dx!="" || dx!="全体对象")
{
var qq=document.getElementById("qq");
var sl=document.getElementById("sl");
sl.value=true;
qq.value=true;
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
var nr2=document.getElementById("txt").value;
if(nr2=="")
{
return alert('---<-请输入内容->---');
}
else
{
xmlhttp.onreadystatechange=stateChange2;
xmlhttp.open("POST","Default5.aspx?nr="+escape(nr2),true);
xmlhttp.send(null);
document.getElementById("txt").value="";
}
}
}
function stateChange()
{
var va=document.getElementById("div_chat");
if(xmlhttp.readystate==4 && xmlhttp.status==200)
{
document.getElementById("div_chat").innerText+=xmlhttp.responseText;
}
va.scrollTop=va.scrollHeight;
}这个是我的聊天信息发送如何更改判断其两秒钟发一句话。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货