4 ms·
If you're going to fetch important quantitative data using a client-side Ajax query, then you really shouldn't default that value to "0". That results in a del
by jnbiche 9y ago
If you're going to fetch important quantitative data using a client-side Ajax query, then you really shouldn't default that value to "0". That results in a delay of several seconds or more when the page displays "0" even if the actual value is say, "12". It would be much better to default to either the empty string, or "-", or "fetching..." or something like that.
In my case, there was a "0" on the page as the main value for at least 5-10 seconds (probably due to HN load) before the correct value was displayed ("12").
- darepublic 9y agoloading message or animation is probably best while the number is fetched.
- harryh 9y agoGood point. Fixed.
- ric2b 9y agoEven better, why isn't the number rendered server-side?