"Questman" <qu******@UBESUXthemajorbbs.com> kirjoitti
viestissä:a8**************@fe07.usenetserver.com.. .
Kimmo Laine wrote:
Java Applet might be what you need. Javascript does not provide such
functionality unless... Hmm. You could possibly make an AJAX/CGI
application which would use a serverside script to telnet and
javascript/xmlRequest to display the output to the client. Still, I'd
start making a Java Applet for that if I were you.
Hi Kimmo,
The problem with an Applet is that many browsers turn off the
functionality for "security" or performance reasons.
Ideally, the goal to get javascript functionality is to have a stock
browser be able to access this content.
Dude, people turn of Javascript as well. That's like saying you don't like
Britney Spears but do like Christina Aguilera because Britney is a stupid
cow. They're both stupid cows! If you want to really have any given browser
to be able to handle it, using javascript is not going to help you at all.
With both of them you are between a rock and a hard place.
The ultimate solution would be to do it like a chat, where you have two
frames: large top and one row bottom. You type the commands in the bottom
frame and submit it, and the output appears in the top frame if it's done
like a chat page. Then the bottom frame just reloads.
How to do the chat page? You gotta use sme server side programming. The key
is open the page, but never close it. Keep on streaming the output, send
some spaces every now and then to keep the connection alive and poll for new
output. When new output appears like maybe in a text file, stream the
textfile and delete it. Then start polling again if new text has a ppeared.
That's like the stupidest thing I've ever written, but it's the solution
that should work in just about any given browser.
Here's a pseudo code
This for the telnet output :
start_telenet_session {
do while(true) {
output_available = poll textfile
if(output_available) {
print output
clear textfile
} else {
sleep 1 second
print " "
}
}
}
This is for the bottom frame :
command_recieved {
execute command
write command output to textfile
reload same page
}
--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Kimmo Laine <et****************@5P4Mgmail.com>