Solved

Streaming text, with focus always on bottom

Posted on 1997-10-30
2
193 Views
Last Modified: 2013-12-25
I found out a way in Netscape to stream text to the browser without any buffering.  In other words, as my CGI programs gets the data (trace data from another program), it sends it to the browser and the browser keeps streaming the data.  Only nice feature missing would be for browser to show the text at the bottom and scroll, instead of keeping focus on top.  I suspect JavaScript might help here, but I know very little about it.  Java's not a realistic option.  
0
Comment
Question by:steve_howell
2 Comments
 
LVL 6

Accepted Solution

by:
Holger101497 earned 90 total points
Comment Utility
The solution is not so complicated: At the top of your file, you have to send the following code:
<script language="JavaScript1.1">
<!-- hide code
function scrollIt() {
  window.scroll(0,100000); //scroll to bottom
  scr_id=setTimeout("scrollIt()",1000);
}
scrollIt();
// end of hiding -->
</script>

This will scroll the window to the bottom once per second (every 1000 milliseconds) (the function calls itself).
Then, when your file is complete, the last lines to send are:
<script language="JavaScript1.1">
clearTimeout(scr_id);
</script>

this stops the scrolling.
If you want to see this code "in action", you can go to netchat.city.de - this is a very nice real-time chat that uses the same technique: it keeps sending lines as people "speak" and displays them right away.

P.S.: This will only work in Netscape 3+, because IE does not support a scroll-function. IE 4 might support it and it would then probably be the same one.

Good luck ;-)
0
 

Author Comment

by:steve_howell
Comment Utility
Great answer.  This should solve my problem perfectly.  
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now