Let's face it. Figuring out whether something is ready for you to interact with is actually quite a complex process. What would you do if you were testing the site manually?
That's simple. If you were manually testing the site, you would wait for it to be ready before you started testing. The problem is, what does the term ready mean?
Well, to me, it means that the page has downloaded and the site has had a chance to render everything that looks like it needs to be rendered and it looks ready to use. Sometimes, I may start using it before it has downloaded all of the images, but I'll usually wait for the main scaffolding to be in a state that looks ready. Unless I'm looking at the network traffic, I won't know whether the AJAX requests have been resolved, but this is where my experience of what the site should look like comes in.
You may have noticed that I used the phrase looks ready a couple of times in the preceding lines. So, how do we code looks ready? Well, the problem...