Depending on the client's connection, auto-refresh the message frame could
be annoying at best.
I can envision a way of doing this entirely in Javascript using frames where
you could autorefresh a "hidden" frame (one that doesn't draw anything),
then use JS to check when a certain control field in that frame changes and
update the main window, perhaps mainly a textarea box. Along the same
lines, the "send a message" client frame would post to a script on your
server that would cause the hidden frame's server source file to update.
Getting it all to work out would be pretty cool...but not specifically cold
fusion. The real trick of it all would be in the javascript; you could use
CF to create the source pages, but thats about the limit of it.
For grins and giggles, heres what I see the logic of individual frames would
be:
Frame:Submit, contains an input box and submit button. Action=post to
server
Frame:MainWindow, contains a textarea for messages and a hidden field called
"lastMessage"
Frame:JSControl, contains some javascript, a variable number of hidden
fields and a meta refresh tag, time delayed 5-10 seconds
The javascript would run everytime the page loads:
int lastMessage=MainWindow.lastMessage
while (there are messages in this frame later than
MainWindow.lastMessage )
{
get the message and message#
append it to MainWindow.TextArea1
set MainWindow.lastMessage = this message number
}
On the server side, you would save the messages in some way, perhaps in a
database; every time you get a post, age out the oldest one and add the
newer one. The JSControl page would refresh and rebuild the message list
from the database. The action page (when they post a message) would
maintain the database and then redirect the client back to the original
framed pages.
Brian
-----Original Message-----
From: Dylan Bromby [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 4:39 PM
To: CF-Talk
Subject: RE: chat room application
you can do it by auto refreshing a message pane with the META tag. if you
want persistence, you should use something like Java or Flash.
-----Original Message-----
From: Jason Green [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 11:38 AM
To: CF-Talk
Subject: chat room application
does anyone know of a place where i can find information about writing a
chat room in coldfusion? or has anyone done this? i'm looking for
something that would be like MSN Messenger, but not having to refresh the
page all the time to view the new chats. if it can't be done in coldfusion,
then i'll have to look elsewhere. thanks.
jason
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists