O
O
OWIII2020-01-13 17:11:10
JavaScript
OWIII, 2020-01-13 17:11:10

Saving AJAX request data after navigating to another page and backtracking on the browser's back arrow?

Hello comrades! Help me please!
I can’t show the code, so I’ll try to explain on my fingers.
1. There is a button on the page. When you click on the button, a table with data from the server is generated.
2. After that, I click on the link in the table - there is a transition to another page (it doesn't matter which one).
3. After that, I press the "back" button, the browser returns me to the previous page in history, but there is no previously drawn table on it (it's understandable - the page has reloaded).
Question: How can I make sure that the data is saved and when I go back I see the table drawn earlier and I would not have to make a second request to the server?
Is there an implementation option without writing data to the browser's storage?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Ivanov, 2020-01-14
@OWIII

It is possible, when receiving a table, to prescribe a hash in the location and, when loading the page, analyze whether the required hash exists. If there is, then we automatically load the table from the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question