无刷新自娱自乐单机聊天室

作者tag: js  web开发  web开发(脚本和动态语言)  聊天室 CSDN 推荐tag: html  自娱自乐  chatcontent  nickname 
<script type="text/javascript">function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>

预览地直:预览
<!--
Author:jom_ch
E-mail:phpoop#Gmail.com
blog:blogch.cn
此为第一版,尚不支持ajax&服务器端存储,仅供自娱自乐.
//-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<TITLE>无刷新自娱自乐单机聊天室Version1.0</TITLE>
<style type="text/css">
 body{font-size:12px;font-family:'宋体';}
 #chatContent{width:400px;height:350px;border:1px solid blue;display:block;overflow-x:hidden;overflow-y:scroll;}
 #chatform{width:400px;height:50px;border:1px solid blue;margin-top:5px;}
 #textArea1{margin:0px;width:300px;height:45px;border:1px solid black;}
</style>
<script type="text/javascript">
 function $I(d){return document.getElementById(d);}
 function $N(d){return document.getElementsByName(d)[0];}
 function tosend(obj){
  nickname = $N("nickname").value;
  if(nickname.length ==0 ){$I("noticeMes").innerHTML = "<font color=red>昵称不可为空</font>"; return false;}
  o = obj.chat.value;
  if(o.length>0){
   $I("chatContent").innerHTML += "<font color=red>"+nickname+"</font>说:" + o + "<br>";
   $N("chat").value = "";
  }
 }
</script>
</HEAD>
<BODY>
<div id="chatContent"></div>
<div id="chatform">
 <form action="" method="post" name="form1">
   昵称:<input type="text" name="nickname" size=10 style="border:1px solid black;"><span id="noticeMes"></span><br>
  <textarea name="chat" cols=30 rows=3 id="textArea1">在这里输入聊天内容</textarea>
  <input type="button" value="提交" onclick="tosend(this.form)">
 </form>
</div>
</BODY>
</HTML>


 

你可能感兴趣的:(JavaScript,mysql,Ajax,D语言,Gmail)