How to create Server-side Progress indicator in JavaScript?

后端 未结 3 1828
我在风中等你
我在风中等你 2021-01-15 08:00

I want to create a section in my site, where a user has a few simple update buttons.

Each of these update buttons will be going to the serv

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-15 08:42

    It's pretty hard to get this right. What we've settled on for our system is a "faked" progress bar - it just animates over and over (which since it is an animated gif, you might expect!).

    An alternative would be to submit to one script, and have that processing in the background (and outputting progress to a file) while making an Ajax request to another script whose only responsibility is to read that progress file and return how far through the process you are. This would work - it feels a little bit kludgy, but it would at least solve your immediate problem.

    I know very little about Comet or the likes, so this is purely based on my current understanding.

提交回复
热议问题