S
S
Stepan2019-07-18 03:10:48
JavaScript
Stepan, 2019-07-18 03:10:48

How to use DB only on client(js)?

I want to make some html file for my own use. In addition to it, I will have, for example, just a text file that replaces the database. How can I display data from a text file using js?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
McBernar, 2019-07-18
@Stepashka20

No way. The client js has no access to the system.
You can take Noda and Express, then you will have access to the files. But it won't be static html anymore.
You can replace the database with localstorage if this option is ok for you.
By the way, nothing prevents you from hardcoding data from a text file directly into js, ​​for that matter.

S
SagePtr, 2019-07-18
@SagePtr

You can use IndexedDB , but you won’t be able to choose a storage location, it will be stored somewhere inside the user profile in the browser, approximately next to localStorage.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question