Solved

Streaming text, with focus always on bottom

Posted on 1997-10-30
2
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
Holger101497 earned 90 total points
ID: 1855394
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
ID: 1855395
Great answer.  This should solve my problem perfectly.  
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
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…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

751 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