For an app like this I would fetch all the data on page load. No need to wait for the user to press a button, as we know we're going to need the data anyway. We might render the whole app on the server anyway, rather than fetching the data from the client separately. But either way, it should happen immediately.
I see you've used XMLHttpRequest
to fetch the data. For getting data like this I would suggest using fetch
instead, it is the standard these days, and you'd likely only find the older method in legacy code.
Be careful with semantics too. You're using multiple <h1>
elements, there should only be one, the main page heading. Your card headings should be level 2.
Make sure that your context triggers are actually buttons, not just an <svg>
with cursor: pointer
. And make sure that button has an accessible label like 'more actions' or something similar.
Marked as helpful
@Zeiyar-Lynn
Posted
@AlexKMarshall Thanks for your explanation.