Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Streaming text, with focus always on bottom

Posted on 1997-10-30
2
Medium Priority
?
201 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 360 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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:
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Suggested Courses

885 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