聊天室编程思想--主动更新与被动更新
主动更新与被动更新
聊天的内容如何显示在屏幕上,一种是每隔一段时间刷新一次页面,读入全部聊天内容,然后显示,这里采用的是js的document.write的方法实现不刷新的聊天页面!
1 主页面的生成,规定了css类型,显示欢迎词
function write2(){
if(this.u.document==null)return;
this.u.document.writeln("<html><head>");
this.u.document.writeln("<meta http-equiv=content-type content=text/html; charset=gb2312>");
this.u.document.writeln("<style type=text/css>");
this.u.document.writeln(".p9 { font-size: 11pt; line-height: 15pt}");
this.u.document.writeln("body { font-size: 11pt; line-height: 15pt}");
this.u.document.writeln("a:visited { font-size: 11pt;color: #0000ff; text-decoration: none;}");
this.u.document.writeln("a:link { font-size: 11pt;color: #0000ff; text-decoration: none}");
this.u.document.writeln("a:hover { font-size: 11pt;color: #ff0000}");
this.u.document.writeln("</style>");
this.u.document.writeln("</head>");
this.u.document.writeln("<body);
//.................. 这里插入生成在线人数组的程序段
this.u.document.writeln("<script>");
this.u.document.writeln("<p class=p9 align=left>"
| 对此文章发表了评论 |
