Update a Web Page as a Process Runs

前端 未结 3 1582

I have a page where a multitude of time consuming functions occur. What I would like to do is as each step of the process is completed, update the web page to let the user k

3条回答
  •  甜味超标
    2020-12-22 07:02

    An ajax request polling at a regular interval is the most common option or you could turn off buffering of the http response and stream the status updates back to the client all within a single http request. If this is a long running operation you need to consider user experience and scalability carefully in the latter scenario.

    Html 5 WebSockets will address this specific scenario also. However, I'm not sure what state these are at within the current crop of Html 5 compliant browsers.

提交回复
热议问题