F
F
ForsakenHedgehog2019-06-21 19:42:15
JavaScript
ForsakenHedgehog, 2019-06-21 19:42:15

How to save changes on page reload (vanilla JS)?

Good day to all!
I am actively studying the web, using the simplest HTML + CSS + vanilla JS. I have not studied any technologies yet, I have only read about JQuery.
In general, the above lyrics are presented to make it easier for commentators to give an answer in terms of my current competence: all sorts of ajaxes, reacts, views are so far obscene curses for me.
There are two questions:
1 - on the topic: I
'm sawing the first site in my life. I made it up without any problems, in styles 1000 lines and porridge (the bison of the frontend would probably strangle it on the spot :) ), I tried simple scripts on all sorts of drop-down menus.
In short, on crutches, but it works. Among the menus - a change in geographical location (selection from the drop-down list). The problem is that the changes, of course, are not saved when the page is reloaded.
Here, for clarity: e931241r.beget.tech
Here, on the toaster, I read something about the cache and interaction with it, but to be honest, I didn’t understand anything. What solutions exist? Maybe you will poke your nose into some article in order to reveal the necessary technologies for yourself.
2 - not quite on the topic:
Not for the sake of holivar, but is it worth spending time on Jquery in 2019? (many people write that it is no longer relevant)
What to study in parallel with vanilla js? Set up for quality development in the frontend.
PS: I apologize for the sheet of text, the first time I write on a toaster.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2019-06-21
@ForsakenHedgehog

you can store the state in localstorage , here is an example for storing the state of checkboxes.
By analogy, you can store the state of anything in this way.
You can also store the state in:
1. IndexedDB
2. In the database on your server.
3. In online services like firebase
4. In Cookies (if not very many)
5. You can even store state in services like Pastebin , or any other services that allow you to post a message / upload a file for long-term storage without entering captcha, but this is already perverted ))))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question