Raymond Camden on Nostr: hard to fit in a toot, but, web dev tip: If you load content after the page is up, do ...
hard to fit in a toot, but, web dev tip:
If you load content after the page is up, do NOT render something like:
0 Cats
and then change it to:
Somenumber Cats
Instead, render something like:
Loading Cats
When I see 0 cats, I assume it's legit. I don't assume it's loading the right #. In fact, I may hit back as I assume I've got no content.
This is a problem with an easy solution.
Earlier blog post on this: https://www.raymondcamden.com/2023/11/15/a-tip-for-properly-handling-loading-states-in-web-apps
If you load content after the page is up, do NOT render something like:
0 Cats
and then change it to:
Somenumber Cats
Instead, render something like:
Loading Cats
When I see 0 cats, I assume it's legit. I don't assume it's loading the right #. In fact, I may hit back as I assume I've got no content.
This is a problem with an easy solution.
Earlier blog post on this: https://www.raymondcamden.com/2023/11/15/a-tip-for-properly-handling-loading-states-in-web-apps