Home >Backend Development >PHP Tutorial >javascript - Display server processing progress in the front desk, similar to delivery effect
I want to know how to achieve a similar delivery effect, that is, one-stop delivery, and the front desk shows that the first order, the second order, and the third order have been shipped. . .
How do you know where the server is processing if ajax is used? It would be best if you could post a simple demo. Thank you
I want to know how to achieve a similar delivery effect, that is, one-stop delivery, and the front desk shows that the first order, the second order, and the third order have been shipped. . .
How do you know where the server is processing if ajax is used? It would be best if you could post a simple demo. Thank you
The simpler one is ajax polling
The more complicated one is websocket
You must have seen similar websites, open 控制台
->网络
and see how the request is sent, you will probably have an idea
As @dryyun said, you can achieve the effect you want through Ajax polling/long polling or WebSocket technology.
I have written a series of related articles that you can read. If you don’t understand, you can contact me:
Comet - a new technology that emerged with the rise of AJAX technology
Ajax polling - "timing" Query the server through Ajax"
Unveil the mystery of Ajax long polling in plain English
Simple and easy-to-use chat room technology - WebSocket