Xmlhttp+javascript+asp Write chat room, no refresh implementation (V)

Source: Internet
Author: User
Tags chr end expression return sendmsg
javascript|xml| Chat Room | refresh | no refresh
This is the most important one. is also very large. My habits are not very good. Without a detailed comment, look carefully.
######## #send. asp##############
<meta content= "text/html; charset=gb2312 "http-equiv=content-type>
<meta http-equiv= ' pragma ' content= ' no-cache ' >
<link rel= "Shortcuticon" url= "Images/bluenote.ico" >
<style type= "Text/css" >
td{font-family: "Song Body"; font-size:9pt}
Body {font-family: "XXFarEastFont-Arial"; font-size:9pt}
Select {font-family: "XXFarEastFont-Arial"; font-size:9pt}
. p9{font-family: "XXFarEastFont-font-size:9pt;line-height:130%; width:68px";
A {cursor:hand;text-decoration:none; font-family: "XXFarEastFont-Arial"; font-size:9pt;}
INPUT{FONT-SIZE:9PT}
. An{background-color:ffffff;color:000000;border:1 Double}
</style>
<title> Speeches </title>
<script language=javascript>
var tmp0= "$F to $t said: | no expression | $F smiled to $t: | smile | $F smiled and said to $t: | giggle | $F $t Silly smile: | giggle | $F to $t smile: | smile | $F to $t laughing: | laughing | $F looking at $t, heart a rapture: | Ecstasy | $F laughing at $t: | laughter | $F to $t smirking: | smirking | $F giggle, very generous to $t said: | generous | $F hold the Hand of $t tightly: | shake hands | $F to $t waved: | waving | $F shrug, hands a booth: $T, | shrug 1| $F helplessly shrug: $ t,| shrug 2| $F touch $t head, fine sound consolation: | comfort | $F smiling to $t one hand: Hand | $F politely made a Yi to $t: | zuoyi | $F bowed deeply: $T, | bowing | $F embarrassed to $t said: | sorry | $F stared, surprised to see $t: Surprised | $F surprised: $T, | surprise | $F looked blankly at $t:| Dazed | $F a face of Confusion: $T, | confused | $F confused: $T, | confuse | $F feel very peculiar: $T, | peculiar | $F to $t a dashing head: | dashing | $F sorry to see $t:| regret | $F $T frowned: | frown | $F Sadly to $t said: | sorry | $F taibaodalan to $t Promise: | commitment | $F scratching scalp, or puzzled: $T, | puzzled | $F raise his voice, loudly to $t said: |
var tmp1= "$F puzzled to ask $t:| inquiry | $F spit out the tongue to $t: | spit | $F very confident to $t said: | self-confidence | $F to Heaven, $T, | pray | $F to $t pursed the mouth: | pout | $F mouth to $t said: | The mouth of the $F calmly to $t said: | calm | $F happily said to $t: | happy | $F whispered in $t's ear: Whisper | $F narrowed his eyes to $t said: | Squint eyes | $F eyes crystal bright $t:| eye Bright | $F happy to see $t:| happiness | $F very satisfied to $t said: | meet | $F Gently holding $t hand, whispered: | hand | $F gently pushed the $t: | push | $F sticky and sticky to $t: a spoiled brat | $F made a face to $t: | grimace | $F mysteriously to $t said: | mystery | $F face flushed, low head whispered to $t said: | blush | $F low head, playing with their fingers, Blushing with shame: $T, | shy | $F kitten nestled in the arms of $t: Snuggle | $F patted $t's dirty little face: | face | $F threw a wink at $t: | winks | $F angrily $t stared: | stare | $F softly to $t said: | softly |$ F affectionately looking at $t said: | affectionate | $F tenderly hug $t said: | hug | $F kissed $t's face: | kiss | $F reluctantly pull $t's clothing: |
var tmp2= "$F to transport the foot gas a sound 断喝: $T!| 断喝 | $F schadenfreude to $t said: | disaster | $F show helpless expression: $T, | helpless | $F to knock himself on the forehead, watching $t:| beat Brain | $F Gu Meditation: $T, | meditation | $F, $T, | Innocent 1| $F feel very innocent, $T: | Innocent 2| $F feel uncomfortable: $T, | discomfort | $F yawning: $T, | yawning | $F foaming at the mouth, fainting in the ground: $T, | foaming | $F was bored: $T, | boredom | $F looked at $t, and was about to vomit: | |$ f a face rogue Popi appearance: $T, | rogue | $F crooked looking at $t, two ball full strength: | Two ball | $F eyes staring at $t, the Minions are full: | minions | $F wronged to $t said: | wronged | $F great frustration: $T, | frustration | $F looking out of the window, the rain, the eyes Dim: $T, | sad | $F sad to $t said: | sad | $F tears in the eye frame of the turn: $T, | tearful | $F looked at $t, was about to cry: | To Cry | $F low Low sobbing: $T, | sobbing | $F A $t hug, cry tears: | $F think of sad place, tears flow such as note: $T, Cry |$ F hug head burst into tears: $T, | cry aloud $F number: $T, | crying | $F to $t disappointed expression: | disappointed | $F with Canthus squint $t, full face is contempt of disdain color: | contempt | $F angrily to $t said: | angry |
var tmp3= "$F strongly protested to $t: | protest | $F shouting to $t: | shout | $F angrily shouted to $t | anger | $F venom to see $t:| venom | $F a hand to lose the $t, hate and hate to say: | Hands off | $F eyes red, blunt $t wrath not to evil roar: | rage | $F played $t, boss. An ear: | slap | $F rudely beat $t a fist: | punch | $F kick in $T's butt: | kick | $F to $t nod is: | nod is | $F cheerfully to $t said: | elated | $F panicked and said to $t: | panicked |$ F gloat to $t said: | schadenfreude | $F exultant to $t said: | exultant | $F enigmatical to $t said: | enigmatical | $F crying days to $t said: | "|" | $F grumble to $t said: | "|" | $F Liquciqiong said to $t: | Liquciqiong |$ F $t said to the $t: | At the very word of the devils: | sinister | $F eyebrow Crooked Eye slanting to $t said: | Eyebrow Crooked Eye Oblique | $F eyes awe-inspiring to $t said: | eyes awe-inspiring | $F hoarse to $t said: | hoarse | $F Italy to $t to say: | F facial expression livid to $t said: | face Livid | $F a distraction to $t said: | A distraction | $F eyes glazed $t said: | eyes Sluggish | $F awe-inspiring to $t said: | awe-inspiring |
var tmp4= "$F unprepared to $t said: | helpless | $F listless to $t said: | listless | $F reluctantly to $t said: | reluctantly | $F kicked and punched to $t said: | kick | $F malicious to $t said: | malicious | $F T said: | All hands | $F triumphantly to $t said: | triumphantly | $F sigh with regret thousands of $t said: | Lament thousands of "
var Etmp=tmp0+tmp1+tmp2+tmp3+tmp4;
var ev=etmp.split ("|")
function WH (FN) {
Fn.open ();
Fn.writeln ("<!--★ Please save as HTML type of File ★-->");
Fn.writeln ("Fn.writeln ("<style type=text/css>.t{color:003366;font-size:9pt;}". pic{font-size:17pt;} Body{font-family:\ "song body \"; Font-size:10.5pt;line-height:160%}a{text-decoration:none}a:hover{text-decoration: Underline}a:visited{color:blue}</style>Fn.writeln ("var autoscrollon=1;var scrollonfunction;var scrollofffunction;");
Fn.writeln ("function scrollit () {if (!parent.sd.ot.as.checked) {Autoscrollon=0;return true;} Else{autoscrollon=1; StartUp (); return true;}} function ScrollWindow () {if (autoscrollon==1) {this.scroll (0,65000); settimeout (' ScrollWindow () ', 200);}} function Scrollon () {Autoscrollon=1;scrollwindow ();} function Scrolloff () {autoscrollon=0;} function StartUp () {Parent.onblur=scrollonfunction;parent.onfocus=scrollofffunction;scrollwindow ();} ");
Fn.writeln ("Scrollonfunction=new Function (' Scrollon () ');");
Fn.writeln ("Scrollofffunction=new Function (' Scrolloff () ');");
Fn.writeln ("StartUp ();</\script>");
}
function Write () {
WH (parent.pub.document);
Parent.pub.document.writeln ("<body text= #000000 bgcolor= #eeeeff >");
Parent.pub.document.writeln ("<div id=\" div0\ ></div> <span style= ' color: #ff0088 ' > Landia chat room </ Span> Center lobby <br> gently tap the sleeping soul, slowly open your eyes, let that yesterday's sadness with chat and go! &LT;HR size=1><div id=ly></ly> ");
WH (parent.my.document);
var myd=parent.my.document;
Myd.writeln ("<body text= #000000 bgcolor= #eeeeff >");
Myd.writeln ("<div id=\" div0\ ></div> <span ' color: #ff0088 ' > style= chat room Landia warm box </span> > ");
Myd.writeln ("<span style= ' color: #0000ff; font-size:9pt ' >[This is your personal box that only shows you the relevant speeches!" ]&LT;/SPAN&GT;&LT;HR size=1><div id=ly></div> ");
}
</script>
<script language= "VBScript" >
Function urlencoding (Vstrin)
Strreturn = ""
For i = 1 to Len (Vstrin)
THISCHR = Mid (vstrin,i,1)
If Abs (ASC (THISCHR)) < &hff Then
Strreturn = Strreturn & THISCHR
Else
Innercode = ASC (THISCHR)
If Innercode < 0 Then
Innercode = Innercode + &h10000
End If
Hight8 = (Innercode and &hff00) \ &hff
Low8 = Innercode and &hff
Strreturn = strreturn & "%" & Hex (HIGHT8) & "%" & Hex (LOW8)
End If
Next
urlencoding = Strreturn
End Function

Function Bytes2bstr (vIn)
Strreturn = ""
For i = 1 to LenB (vIn)
Thischarcode = AscB (MidB (vin,i,1))
If Thischarcode < &h80 Then
Strreturn = Strreturn & Chr (Thischarcode)
Else
Nextcharcode = AscB (MidB (vin,i+1,1))
Strreturn = Strreturn & Chr (CLng (thischarcode) * &h100 + CInt (nextcharcode))
i = i + 1
End If
Next
Bytes2bstr = Strreturn
End Function
</script>
<script language= "JavaScript" >
var me= "<%=session (" U_name ")%>";
<%if session ("u_sx") = "1" then%>
var msx= "Girl.gif";
<%else%>
var msx= "Http://www.pcdog.com/edu/asp/2005/09/boy.gif";
<%end if%>
var ts=new oS ();
function OS ()
{this. F= "";
This. T= "";
This. E= "";
This. w= "0";
This.sc= "";
This.cl= "";
This. send=sendmsg;
}
function Checksays ()
{if (document.say.says.value== "") {alert ("What do you want to say?") "); return false;}
var Fm=document.say;
var Sc=fm.says.value;
var f=me
var t=fm. T.options[0].value;
var E=document.ot.userface.selectedindex;
var w= "0"
var Cl=fm.says.style.color;
Fm.says.value= "";
Fm.says.focus ();
Ts.f=f;
ts.t=t;
ts.e=e;
TS.SC=SC;
TS.CL=CL;
Ts.w=w;
SetTimeout ("Ts.send ();", 20);
Delete (F);d elete (SC);d elete (FM);d elete (CL);d elete (T);d elete (E);
return false;
}
function sendmsg ()
{if (this. t== "" && this. f== "") {alert ("Who do you want to speak to?") "); return;}
crld=1;
var ss= "f=" +code (this. F) + "&t=" +code (this. T) + "&sc=" +code (This.sc) + "&cl=" +this.cl+ "&e=" +this. E
Ss=urlencoding (SS)
var osend=new activexobject ("Microsoft.XMLHTTP");
Osend.open ("POST", "say.asp", false);
Osend.setrequestheader ("Content-length", ss.length);
Osend.setrequestheader ("Content-type", "application/x-www-form-urlencoded"); I don't play without that.
Osend.send (SS);
var odom=new activexobject ("Microsoft.XMLDOM");
Odom.async=false;
Body=bytes2bstr (Osend.responsebody);
alert (body);
Odom.loadxml (body);
if (oDom.parseError.errorCode!= 0)
{alert (body);
Alert ("Sorry. Error occurred");
return}
Else
{var aryf=odom.documentelement.selectnodes ("F");
var aryt=odom.documentelement.selectnodes ("T");
var arysc=odom.documentelement.selectnodes ("SC");
var arycl=odom.documentelement.selectnodes ("CL");
var arysj=odom.documentelement.selectnodes ("SJ");
var arye=odom.documentelement.selectnodes ("E");
var tmphtml= "";
var img= "";
Lengt=aryf.length;
for (Var i=0;i<lengt;i++) {
img= "Tmphtml= "<font style=\ ' Cursor:hand;color:" +arycl (i) text+ "\ >" +document.ot.userface.options[arye (i). Text] . VALUE+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;
}//End for
}
Delete (ARYF);d elete (ARYT);d elete (ARYSC);d elete (ARYCL);d elete (ARYSJ);d elete (Arye);
Delete (ODom)
Delete (osend)
Delete (tmphtml)
}
function code (STR)
{var A = new RegExp ("'", "GI")
var B = new RegExp ("\", "GI")
STR = str.replace (/&/gi, "&")
STR = str.replace (/</gi, "<")
STR = str.replace (/>/gi, ">")
STR = str.replace (B, "" ")
STR = str.replace (/&/gi, "{^amp]")
Delete (A)
Delete (B)
Return (STR)
}
function Rp2 (str,fs,is)
{while (Str.indexof (Fs)!=-1)
STR = str.replace (Fs,is)
Delete (A);
Return (STR)
}

'---This page is not complete-------------

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.