[MUD-Dev] javascript

Laurel Fan lf25+ at andrew.cmu.edu
Wed Mar 15 14:58:36 New Zealand Daylight Time 2000


Excerpts from muddev: 15-Mar-100 Re: [MUD-Dev] javascript by
=?iso-8859-1?Q?Gr=F at ifi. 
> The real challenge is to come up with something very simple and powerful
> that 50-90% of the web population can load and use.

Doing something entirely in Javascript is probably not the best way to
do this.  Javascript isn't usually thought of as powerful, and the more
'powerful' features you use, the less simple it gets.  You're also
not guaranteed that it'll work the same way or even work at all on
two different browsers (and it'll have to work in both IE and Netscape
to get a large majority of people).

If want to allow playing your mud from a web browser, consider doing
something on the (web) server side.  There are plenty of html-only
(with none or minimal javascript) chat/irc type applications.  The
basic principle of these is usually:

1. Have two frames, 1 for input, 1 for output.
2. Keep a connection to the mud.
3. Have the output frame refresh every 10 seconds or so.  The mud dumps
   its output into a file, and your script sends the tail of the file
   every time it's loaded.
4. The input frame is a form, containing a text field that submits to
   the script.  The script sends the contents of the text field as
   input to the mud.

(Alternatively, you could have only 1 frame, and only refresh
on a submit, which is easier and probably preferable if people will
be entering commands quickly more than they'll be sitting there
watching things scroll past)

To me this sounds easier, since I know more cgi scripting than I do
javascript, and you also have the advantage that if it's done right,
it'll work in any browser, but YMMV.




_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev



More information about the MUD-Dev mailing list