Solved

Streaming text, with focus always on bottom

Posted on 1997-10-30
2
195 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Angular 2 - Issue in page Layout 2 59
Wrapper for APPs 9 76
push logos in footer up higher 5 20
Background video not displaying in Internet Explorer. 3 22
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
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.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
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.

770 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