Answer the question
In order to leave comments, you need to log in
How is the receipt of letters implemented without refreshing the entire page?
Let's take any mail. If you send a letter there, then after 1-5 seconds it appears in the list of letters.
tr is added. The list of letters in the mail is a regular table to which rows are added.
But the page is not refreshing. So either Ajax is used, or something else. What options are there for the implementation of mail? So that, for example, a person has an open mail or a list of orders, and if something comes from the user, it also appears.
Answer the question
In order to leave comments, you need to log in
The simplest implementation is to send requests to the server on a timer using Ajax, and redraw the block with letters using a callback. You can implement it pretty quickly if you want.
Minus - the load on the client, and the server must process a large number of requests.
This functionality does not involve sending events from the browser to the server. Therefore, let's say sockets are redundant in my opinion. For my taste, the best solution would be to use Server-sent events https://developer.mozilla.org/ru/docs/Web/API/Even...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question