I am using javascript to run a XMLHttpRequest to a PHP script which returns data. Basically I want to be able to provide the user with a progress bar (instead of a spinning circle or something) that shows the progress of getting and receiving the data. I know if I was getting a file, I could just check the content length header and use that, but in the case of a script, you don't know how much data it's retrieving.
The answer to this might be as easy as, "it's not possible," because right now it seems that way. But in conclusion: How do you monitor progress of a running script (php) over and XMLHttpRequest? There could be a dozen different ways to do this. It kind of depends on what the PHP script is doing, and what kind of server side technology you have. Can you be more specific?
以上就是Getting XMLHttpRequest Progress from PHP Script的详细内容,更多请关注web前端其它相关文章!