|
A humble request: please don't make spinners (GIFs, CSS animations, whatever) visible in the initial response HTML of a page, if they're meant to indicate some sort of AJAX loading. Lots of sites do this, but it's unfortunately too robust. The spinner will appear, and run forever, even if: - We forgot to embed the JS that does the AJAX loading - The JS has an error before it even makes a request - The src URL of a script doesn't exist - Some cross-domain issue prevents a script loading - The user agent doesn't support JS I accept that it can be tricky to remove a spinner correctly in the face of certain error conditions, but it's trivial to avoid showing it until it's meaningful. So please: only insert/reveal spinners programatically, just before the associated request is made. In fact, this same logic applies to all UI elements that are only meaningful thanks to JS (e.g. buttons that require an event handler, rather than submitting a form); such things should be inserted/revealed programatically using JS, not visible in the initial response HTML, so we don't end up clicking over and over on a button that's useless, etc. I get that many Web devs these days don't care about progressive enhancement, and like to assume all users have HTML5+CSS+JS+etc. but even that assumption doesn't excuse spinners that lie when a connection fails, or a server is misconfigured, or a third-party moves some assets, etc. |