The project requires real-time interactive viewing of customer order status.
The current page already has an ajax long polling, responsible for checking whether there are new orders.
Now there is a need to do one to see if there is new feedback... .
After I turned off polling, I found that it was no longer stuck.
Now I need to do two, will it crash directly?
The current long polling of the page is executed after the page is loaded, which makes the page seem to have been loaded forever.
It keeps turning on the title.
Do I need to add a setTimeout() to it?
phpcn_u15822017-05-16 13:00:29
Since there is Ajax, change your method into an interface and get one or two or more results based on the passed parameters, so there is no need to initiate multiple requests
为情所困2017-05-16 13:00:29
The previously launched websocket protocol can meet your requirements and is also based on http.
https://socket.io/ recommends you one.
给我你的怀抱2017-05-16 13:00:29
html5 SSE (EventSource) server pushes to the client in real time, simpler than websocket