Home>Article>Backend Development> Ajax implements partial page refresh--message refresh

Ajax implements partial page refresh--message refresh

little bottle
little bottle forward
2019-04-22 11:26:58 3163browse

Recently, some friends were curious about the message board displaying messages that are constantly being refreshed. What is the implementation principle? Generally, sending a message means sending data to the server through normal ajax, while displaying the message in real time requires polling. This article mainly talks about using ajax to refresh the message status. It has certain reference value. Interested friends can learn about it.

What is polling: It uses a timer to initiate requests from the client to the server at fixed intervals.

Case code demo: