D
D
darknet372017-03-22 11:32:27
Yii
darknet37, 2017-03-22 11:32:27

How to update the data on the site only when it changes. PJAX?

I display data from the session, and when the data in the session changes, I need to display the changes. And you need to do it without reloading the page.
How can I do it?
Tell me please. Thanks in advance)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
padlyuck, 2017-03-22
@darknet37

Webosket or Periodical Ajax.
The first option: the server itself sends a command to the page that the data has changed and you need to pull the pjax update method.
The second option: the page periodically pulls the server with Ajax to see if the data has been updated or not. if updated - the page pulls the pjax update method.
The second method is simpler, because you don’t need to configure anything and you don’t need to read any manuals, but there is no guarantee that the second method will not fail in six months, because https://www.opennet.ru/opennews/art.shtml?num=46207

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question