Scrolling log files

Discussion in 'HTML' started by Chris, Feb 27, 2004.

  1. Chris

    Chris Guest

    I got a log file I'd like to scroll on the screen as new entries are added
    to the bottom. So far, I've written a little code that grabs the last X
    lines from the file and displays them in a < textarea >. The user hits
    "refresh" to see more recent entries.

    The trouble is that I can't get the textarea to scroll to the bottom so the
    most recent entries are visible.

    1. Is there a way to get textarea elements to automatically put the cursor
    at the bottom?
    2. More generally, is there a better way to do this user interface?
    Chris, Feb 27, 2004
    #1
    1. Advertising

  2. Chris wrote:

    > I got a log file I'd like to scroll on the screen as new entries are added
    > to the bottom. So far, I've written a little code that grabs the last X
    > lines from the file and displays them in a < textarea >. The user hits
    > "refresh" to see more recent entries.
    >
    > The trouble is that I can't get the textarea to scroll to the bottom so
    > the most recent entries are visible.
    >
    > 1. Is there a way to get textarea elements to automatically put the cursor
    > at the bottom?
    > 2. More generally, is there a better way to do this user interface?


    I assume you use some server side coding to do that too, so why not toss
    your output from the script into an array and reverse that array?
    Then you output the reversed array and the newest entries of your logfiles
    will always be at the top of the textarea.

    /Andreas
    --
    Registeret Linux user #292411
    Andreas Paasch, Feb 28, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Henrik_the_boss
    Replies:
    0
    Views:
    2,647
    Henrik_the_boss
    Nov 5, 2003
  2. Amratash
    Replies:
    0
    Views:
    520
    Amratash
    Apr 13, 2004
  3. =?Utf-8?B?VG9tIFdpbmdlcnQ=?=

    My.Log.Writeexception not writing to Application Event Log.

    =?Utf-8?B?VG9tIFdpbmdlcnQ=?=, Jan 20, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    2,371
    =?Utf-8?B?VG9tIFdpbmdlcnQ=?=
    Jan 20, 2006
  4. unomystEz
    Replies:
    0
    Views:
    549
    unomystEz
    Nov 19, 2006
  5. Chris

    Scrolling a log file in a page

    Chris, Mar 1, 2004, in forum: Javascript
    Replies:
    2
    Views:
    93
    Chris
    Mar 1, 2004
Loading...

Share This Page