Xmlhttp+javascript+asp Write chat room, no refresh implementation. Original code to broadcast! Server supports ASP to use (vi) END

Source: Internet
Author: User
xml| Server | chat Room | refresh | no Refresh | original ############ #续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);
}
Functions Getxmldata ()//This is the function that refreshes the user's XML data
{crld=1;
Ordom.load (Path)
if (oRDom.parseError.errorCode!= 0)
{Alert ("Sorry. Error occurred");
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<lengt;i++) {
img= "Tmphtml= "<font style=\ ' Cursor:hand;color:" +arycl (i) text+ "\ >" +ev[arye (i) Text*2]+rp2 (ARYSC (i). Text, "{^ AMP] "," & ") +" </font> <span class=t>["+ARYSJ (i) text+"]</span><br> ";
Tmphtml=rp2 (tmphtml, "$F", "<a href=\" javascript:parent.sd.towho (' +aryf (i) text+ "'); \" > "+img+aryf (i). text+ "</a>");
Tmphtml=rp2 (tmphtml, "$T", "<a href=\" javascript:parent.sd.towho (' +aryt (i) text+ "'); \" > "+aryt (i) text+" </a> ");
if (Aryf (i). Text==me | | Aryt (i)-text==me)
{parent.my.ly.innerhtml+=tmphtml;
} else
parent.pub.ly.innerhtml+=tmphtml;
}
}
Delete (ARYF);d elete (ARYT);d elete (ARYSC);d elete (ARYCL);d elete (ARYSJ);
}
function towho (un) {
Document.say.t.options[0].value=un;
Document.say.t.options[0].text=un;
Document.say.says.focus ();
</script>
<base onmouseover= "parent.window.status=" Welcome to the Blue Butterfly Boutique Network www.ChinaOk.net webmaster: Netnice qicq:6097356 '; return true; >
<body bgcolor= "#76b4d9" topmargin= "4" leftmargin= "1" >
<table border= "0" width= "767" cellspacing= "0" cellpadding= "0" >
&LT;TR&GT;&LT;TD width= "735" height= "align=" "left" nowrap>
<form method= "POST" action= "save.asp" name= "Say" target= "B"; Document.say.says.focus (); ">
<option value= "Everyone" selected> everyone </option>
</select> said: <input type=text name= "says" maxlength= "" size= "style=" Background-color: #ffffff; BORDER-BOTTOM:1PX Double; BORDER-LEFT:1PX Double; BORDER-RIGHT:1PX Double; BORDER-TOP:1PX Double; CO



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.