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

Source: Internet
Author: User
xml| Server | chat Room | refresh | no Refresh | original use of XML. Without constant refresh. Asp.
No refresh to achieve the article by article display.
Use Application variables to store chat records, so you need to create a virtual directory
The server side does not need to support XML, as long as it supports ASP and can build virtual directories.
The following code is passed on the nt4.0+iis4.0. I reckon it's about the same under your Win2000.
If there is a problem, please enlighten: netnice@chinaok.net

######### #index. asp##############################

<title> Landia Chat Room www.chinaok.net</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<style type= "Text/css" >
BODY{FONT-SIZE:9PT}
TD{FONT-SIZE:9PT}
. Tbljm{border-bottom: #000000 1px solid; Border-left: #000000 1px solid; Border-right: #000000 1px solid; Border-top: #000000 1px solid;color: #000000;}
</style>
<script language= "Javascript" >
function Openwin ()
{winst= "status=yes,scrollbars=yes,resizable=yes,width=" + (screen.availwidth-10) + ", height=" + ( SCREEN.AVAILHEIGHT-50) + ", top=0,left=0";
window.open (' About:blank ', ' 7923sdfsdfs ', winst);
}
function Form_onsubmit (obj)
{var no=0,psd= "1234567890";
if (obj.  username.value== "") {alert ("Please enter your nickname!\n"); Obj. Username.focus (); return false;}
if (obj. UserName.value.indexOf ("") >-1 | | Obj. UserName.value.indexOf ("'") >-1 | | Obj.  UserName.value.indexOf ("\") >-1) {alert ("Your nickname contains an illegal character!\n"); Obj. Username.focus (); return false;}
Openwin ();
return true;
}
</script>

<body bgcolor= "#ffffff" text= "#000000" valign= "center" onload= "Javascript:document.form1.ok.blur ()" background= " Images/greystrip.gif ">
<center><table border=0 width= "67%" >
<TBODY>
<TR>
&LT;TD valign=center align= "Middle" style= "font-size:10.5pt" ><font color= #0033ff::::::::::</font> </TD>
</TR></TBODY></TABLE></center>
<table width= "border=" 0 "style=" border-right: #003366 1px solid; Border-top: #003366 1px solid; Border-left: #003366 1px solid; Border-bottom: #003366 1px solid "cellspacing=" 0 "cellpadding=" 0 "align=" center ">
<tr>
&LT;TD bgcolor= "#304d7c" height= ">"
<div align= "center" ><font color= "#ffffff" > User login </font></div>
</td>
</tr>
<tr>
&LT;TD height= "121" >
<form name= "Form1" method= "Post" action= "main.asp" onsubmit= "return Form_onsubmit (This)" target= "7923sdfsdfs" >

<table width= "199" border= "0" cellspacing= "0" cellpadding= "0" background= "images/greystrip.gif" >
<tr>
&LT;TD height= ">"
<div align= "center" > User name:
<input name= "UserName" size= "maxlength=" class=tbljm>
</div>
</td>
</tr>
<tr>
&LT;TD height= ">"
<div align= "center" > Sex:
<input Type=radio value= "0" name=sx checked> male | <input type= "Radio" value= "1" name=sx> female
</div>



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.