The most important function of a chat room is that all users can receive the message after a user sends it. After receiving the message, the user should mark or delete the message. The Application Object of ASP can realize data interaction between sessions. Combined with the built-in object scripting. dictionary similar to map, it should be able to achieve the desired effect. However, scripting is found in the actual writing process. the dictionary object instance cannot be stored in the application at all. After checking msdn, it is not allowed to store objects other than the custom components to the application, including custom class and dizzy, you have to find another solution, and finally select to use the array method.
On the client side, I wrote a chatroom class using the prototype (prototype) function of JavaScript, and implemented sending, receiving, logging on, and exiting messages in an object-oriented manner. The following is the chat window. Enter a nickname to log on and start chatting. :) There are many bugs in the program, so you have no intention of debugging.
Download: http://www.duduwolf.com/test/chatRoom.asp.txt
<Script language = "JavaScript" type = "text/JavaScript" src = "http://www.duduwolf.com/test/chatRoom.asp? Act = script "> </SCRIPT>
<Div id = "chatroom"> </div>
<SCRIPT> var chat = new chatroom ('chat', document. getelementbyid ('chatroom '), 500,400); </SCRIPT>