As I work on loading a new page and a CSS file for it using AJAX, I encounter an issue.
Once all the CSS files are added to the page, I set the opacity to 1, expecting the page to display with the CSS applied immediately. However, it initially appears without the CSS, and only after a short delay does the styling kick in. This delay is unattractive and I am seeking a solution to prevent it.
I have not been able to find a straightforward method to detect when the CSS has fully loaded.
Does anyone have any insight into why this is happening? My theory is that the CSS may not be completely downloaded yet, but I am unsure of how to address this issue.