0

I am outputting 10k+ separate lines in a div. Something similar to what you see in console output in a continuous integration app (like Jenkins). I noticed when I reach a threshold the scrollbar is non-responsive.

I noticed this trick (Managing HTML5 DIV Size) would keep it showing only X number of lines in the div but it clears out the remaining lines so the user can't see all the lines of text.

What are my optioons to still show the user all the data within the div and still have good response on the scrollbar?

Community
  • 1
  • 1
JoeCoder
  • 354
  • 2
  • 8

1 Answers1

0

From a normal user perspective - I agree 10k+ in a div is poor user experience. But - the users who would be using this tool actually prefer a command line console-like experience where text is just getting spit out to the client asynchronously and they see it in "real time."

Anyway - I did find the problem. I was appending to InnerHtml as I was getting data per line from the server (using Server Sent Events). Using appendChild() made the scrollbar much, much more responsive since it doesn't cause a complete rebuild of the DOM each time.

Here's a discussion on this topic:"innerHTML += ..." vs "appendChild(txtNode)"

Community
  • 1
  • 1
JoeCoder
  • 354
  • 2
  • 8