Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
How do you store large amount of text for a webpage

I have a book in docx format (about 25,000 words) and I want to display about 400 words at a time on my webpage. In Python, I have an algorithm that separates the text into pages and stores that in a dictionary; however, the frontend uses JavaScript.

I have tried to export the Python output as a txt/json file, but it seems that JavaScript doesn't allow automatic file uploading and instead requires the user to upload the documents which won't work for my situation. So, do I have to store all of the text (25,000 words) in an html document and then run a JavaScript version of the Python algorithm on that and then save it into local storage or some JavaScript container?

I want to avoid using a web host for this since I don't think it is necessary.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You would typically build a web API for retrieving data, you would use a database/flat file store for storing the data and the frontend would form the presentation part. Depending on your usecase and if you are not familiar with databases, I'd suggest as a first step you could just store the pages as simple files on the backend.

So, your data i.e. the pages of the book would be stored in text or JSON. Your backend service(which can be in Python or JS or pretty much any other popular language) would have APIs that facilitate retrieving these webpages and your frontend(HTML + CSS + JS) would be responsible for capturing user input and requesting data from the backend service.

So, the flow for reading a page becomes -

  1. The user opens the frontend, which would comprise of HTML + CSS + JS
  2. The frontend retrieves a page from the backend API
  3. The backend API reads the page on your machine and returns it

If the only reason you don't want to use a backend or host is because it is not required, in my opinion what you are trying to build would typically require a backend service since you'd generally want to have control of data so that you can have other mechanisms for auth, updates to the pages, etc.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!