2/3 Hello, I'm trying to create an HTML page that'll give you live
"tail -f logfile.log" output. I can do it with regular HTML,
but the problem is the user has to constantly scroll to
the bottom. Is there a javascript or something that'll
simply scroll to the bottom for you? Thanks.
\_ Every time there's an update, just output the data to the page and
end it with (replace 42 with number of new lines):
<script>window.scrollByLines(42);</script>
This might not work in IE, though. You could do something with
plain window.scroll(x,y), but it will be more work. --dbushong
\_ Any reason you don't put a "<a name="end">" at the end and then go
to the page as "page#end"?
\_ I don't think that would repeatedly move you to the end, which
is what (s)he's trying to do.
\_ I'm pretty sure you could jump to the anchor with an onload
action in the body tag. -gm
\_ You're missing the point, this is a continuously updating
page that you keep occasionally adding new data to. An
onload only fires once. A #fragment only fires once.
\_ meta refresh? |