S
S
sitev_ru2015-09-14 07:28:56
Java
sitev_ru, 2015-09-14 07:28:56

How to work with history and AJAX calls correctly?

I add some element to the page using AJAX. Then I follow the link. When I go back, the element has not been saved in history and, of course, is missing. But when I refresh the page with F5, the element appears because I added it to the database during the AJAX call.

How to solve the problem?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
notlimitedwolf, 2019-04-17
@notlimitedwolf

Servers are full

V
Volodymyr Palamar, 2019-04-14
@GORNOSTAY25

As far as I understand, it wants to refer to an element that does not exist

G
GM2mars, 2015-09-14
@GM2mars

If you do not have all the data loaded by Ajax, but only some blocks, it is better to change the url when changing the page state. Like opened the side menu, added /?sidebar=1 to the url. On it and determine what changes are on the page. From the outside, the backend needs to be redone so that it takes into account the parameters when returning a response. If it's a one page app, then there's a slightly different story...

S
sitev_ru, 2015-09-14
@sitev_ru

Added, for example, a line in the table. They put Ajax in the base and what to do next?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question