Clear questions and runnable code
get the best and fastest answer
Re: CGI & HTML Framesby andreychek (Parson)
|on Aug 15, 2002 at 18:34 UTC||Need Help??|
Another method you might be able to use is with the OpenThought Web Application Environment. OpenThought allows you to communicate with the server, and update the browser window, without actually reloading the webpage.
This would allow you to build your chat room, without needing seperate frames for each component. So, lets say we have a textarea where the chat message goes called "chatwindow", and a textarea where the user types in their message called "newtext", with an associated submit button right next to it. The way it would work then is the user would type in their new text into the "newtext" textarea, and hit submit. The page doesn't refresh -- instead, the data the user typed in is sent to the server, where you can do any amount of processing on it, and then respond back to the browser. In this case, your response might be to update the "chatwindow" textarea with the latest text, while clearing out the "newtext" textarea.
The code to make that work would look something like:
In the above, the functions "log_message()" and "get_last_ten()" are hypothetical subs that you would write as part of your chat program. Everything else exists in the framework as seen.
Thats the skeleton of what you would need in order to make this work using OpenThought. See the demo app that comes with the distribution for an example of an entire working application. There's also a lot of documentation which comes with the module.
You can find OpenThought at openthought.net. The release thats out now works well, but I highly recommend grabbing the version currently in CVS. There is about to be a new release, and all sorts of neat goodies have been added and/or fixed.
Lucy: "What happens if you practice the piano for 20 years and then end up not being rich and famous?"
Schroeder: "The joy is in the playing."