xmlHttp+xml+asp实现无刷新聊天室(一)

来源:半月设计 发布人:GuoBar 发布时间:2005-7-20 15:24:40 人气: 所属栏目:ASP研究-ASP

**********************

xmlHttp+xml+asp实现无刷新聊天室
GuoBar.Com版权所有
http://www.guobar.com/chat_index.asp

**********************

index.asp

< %session("u_Lid")=Application("c_Lid")-12
%>
< html >
<head>
<title>www.guobar.com</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("请输入你的昵称!\n");  obj.UserName.focus(); return false;}
  if(obj.UserName.value.indexOf(" ")>-1 ||obj.UserName.value.indexOf("'")>-1 || obj.UserName.value.indexOf("\"")>-1){alert("你的昵称含有非法字符!\n");  obj.UserName.focus(); return false;}
  openWin();
  return true;
}
</script>
</head>

<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>
      <TD valign=center align="middle" style="FONT-SIZE: 10.5pt"><FONT color=#0033ff>:::::  :::::</FONT> </TD>
    </TR></TBODY></TABLE></center>
<table width="400" 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>
    <td bgcolor="#304d7c" height="25">
      <div align="center"><font color="#ffffff">用户登陆</font></div>
    </td>
  </tr>
  <tr>
    <td height="121">
<form name="form1" method="post" action="main.asp" onSubmit="return form_onsubmit(this)" target="7923sdfsdfs">
             
        <table width="399" border="0" cellspacing="0" cellpadding="0" background="images/greystrip.gif">
          <tr>
            <td height="35">
              <div align="center">用户名:
                <input name="UserName" size="10" maxlength="20" class=tbljm>
            </div>
          </td>
        </tr>
        <tr>
            <td height="41">
              <div align="center">性&nbsp;&nbsp;别:
                <input type=radio value="0" name=sx checked>男 | <input type="radio" value="1" name=sx>女&nbsp;
              </div>
          </td>
        </tr>
        <tr>
            <td height="40">
              <div align="center">
                <input type="submit" name="ok" value="登 陆" class=tbljm>
                <input type="reset" name="nook" value="重 写" class=tbljm><BR><br>
                <font color=red>xmlHttp实现的无刷新技术即时聊天室,不保存聊天记录</font><br>
              </div>
          </td>
        </tr>
      </table>
    </form></td>
  </tr>
</table>
</body >
< /html >




生成时间:2006-5-27 2:00:34