View Single Post
  #2 (permalink)  
Old August 8th, 2004, 12:57 PM
Christiaan van Opstal Christiaan van Opstal is offline
Authorized User
Join Date: Aug 2004
Location: Chicago, IL, USA.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts

If you're building this to gain some new skills or demo your work, AWESOME! If this chat room is going to be heavily used, you might want to reconsider. ASP wasn't built to handle something like this and you're going to run into a lot of problems when a lot of people start using it. Having said that, here's a few things to keep in mind:

- The most obvious way to keep track of who's in the chat room is to create a table that lists the people currently chatting. Avoid this. When a person closes their browser without logging out, their name will be stuck in the in the table and screw everything up. You're probably going to have to write some code that (a) updates a timestamp in their profile when they post, login, or refresh the chat window and then (b) tracks only users who've had activity in the last 15 minutes or so. This method does have a higher overhead cost on the server but it's still preferable to having names stuck in the 'Current Users' table indefinitely.

- Everytime you refresh the chat window it's going to have to load a lot of content. A better way to do it would be to include a hidden iFrame that refreshes and then uses JavaScript to add content using the innerHTML command. This isn't as cross-browser friendly as the simpler method, but it's faster.
If you do end up just using a single frame to load the chat content, make sure to add a bookmark at the end of the text so that people don't have to scroll down to view the new messages. Or, alternatively, you could just post the new content on top of the screen but this is counter-intuitive for most users.

- Finally, users are going to hear a click evertime the iFrame refreshes. There's no way to turn this off from your end. Either the user will have to disable it manually on their browser, or mute their speakers, otherwise the constant clicking will drive them nuts.

I hope this was helpful in some way.

Good luck on your project,


Hope this helped in some way

Reply With Quote