|
|
|
|
|
by shurcooL
4676 days ago
|
|
I think spinners are absolutely worthless on the internet, they tell me next to nothing. I could be looking at it for another second or it may keep going indefinitely. A progress bar, no matter how bad, can tell me there is progress being made. The spinners are more suitable for local apps like games and operating systems. If I see a spinner in a game, I know it hasn't frozen and should eventually finish loading. |
|
Except it can't, really, because browsers don't expose any kind of "percentage complete" information to javascript code. Partly that's because the browser doesn't always know; if the response uses chunked encoding (common for anything that's not a static file), the initial headers don't indicate the length of the response, so the browser doesn't know what percentage of the response it's got until it's got the whole thing.
Basically, from the HTTP protocol up the stack is designed in a way that makes it really hard to know how much longer it's going to be before a request is complete. It's designed that way for good reasons, but the unfortunate side effect is that progress bars that have any degree of meaning are generally not possible for non-static content.
That's why we have spinners. They provide the user with feedback that says "yes, I saw that you clicked that, and I'm doing something about it", which is crucial, but they don't depend on knowing how long it'll take to do whatever is being done. Most of the time that's fine if the request completes within 10 seconds. Any longer than that and additional feedback is probably necessary, maybe using setTimeout().