Home >Backend Development >PHP Tutorial >javascript - Display server processing progress in the front desk, similar to delivery effect

javascript - Display server processing progress in the front desk, similar to delivery effect

WBOY
WBOYOriginal
2016-07-06 13:53:14885browse

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

Reply content:

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn