Hello to all! Tell me, please, this question: the task is to display a huge text file on a web page. There is an idea to do this Javascript with Ajax. Accordingly, there is a need for a certain script component that would display only the current fragment of the file. But when the user scrolls the text down or up, then the Ajax'om component would download another file fragment from the server (on the Java + JSP + Spring server). I saw scripts like Facebook - they deploy content when the user scrolls down. And I would like it to work both up and down, and so that the text does not accumulate. In Facebook, when you scroll down, the top part of the content does not disappear, but I need it to be cleared and reloaded, if the user scrolls up. It is also desirable that the component allows you to generally move to an arbitrary place in a text file.

Are there such components in nature?

Closed due to the fact that the question is too general for the participants Dmitriy Simushev , aleksandr barakin , Grundy , D-side , Nick Volynkin 22 Apr '16 at 7:32 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • .. the upper part of the content does not disappear, but I need it to be cleared and reloaded, if the user scrolls up. Why clean, what it bothers you? - hindmost
  • one
    the browser will not crack display such as gigabytes of text? - i.polyakoff
  • one
    Well, it will not be immediately displayed in your entirety, but in parts. And I can hardly imagine a user scrolling a gigabyte of text in one session. - hindmost
  • one
    In fact, your task is to break the text into parts, parts are stored for sure in the database. The first thing that can "crack" is the repository. You will not break the text in memory every time? How to break? Suppose request. Next, you need to create a certain handler that will produce chunks of text, your task is to monitor the scroll events and load a new chunk at the end of the page, adding an array of paragraphs to the DOM and deleting the old ones (I think it will be reasonable to store several screens). The total number of screens can be issued with each block to display a full-size block. - Cyrus
  • Why am I doing this? To the fact that the task is too specific for the repository. It is also necessary to somehow handle an arbitrary scroll and level the difference in the height of the screens. So you can decompose the task and arrange in the form of several questions. - Cyrus

0