6

聊天室似乎没有想象中那么难做

 1 year ago
source link: https://jiongks.name/blog/2009-10-18
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

聊天室似乎没有想象中那么难做

本文摘自 勾三股四 更早时期的 不老歌 博客。


最近看到一个聊天室的例子:http://css-tricks.com/jquery-php-chat/

与其说是一个聊天室的demo,不如说是借这个demo构建了一个聊天室的开发原型。

一个聊天室要有通信机制,要有身份识别机制,要有数据存储机制,要有表现机制。这差不多就可以简要概括一个聊天室的构建:

通信机制
需要Web的Ajax前台和Php后台协同工作,这里分为获取已有数据(这里是定时循环获取的)以及发送新数据(留言)这两点,额外还有一个页面初始化的操作(确定数据的起始点)。

以上三部分分别对应源代码中的:

Related Issues not found

Please contact @jinjiang to initialize the comment


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK