Ajax Chat Room)

Source: Internet
Author: User
Tags ajax chat

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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.