I'm working on a web application built with the original Struts framework. Our jsp files build the HTML using a web service, meaning that as the web page loads, we end up waiting for data to come back to build the HTML. (I've attached code that shows how an entire body is built using these types of calls.) We also end up waiting for some javascript libraries to execute.
On a particular webpage, I have multiple buttons that are all styled in a specific manner. When loading the webpage, the buttons show up for a split-second with the default style of the web browser, and then end up having the CSS applied. I would like to hide this rendering problem from the user.
I've read these suggestions from StackOverflow: Force browsers to load CSS before showing the page
A JavaScript solution is not great, because not everyone has JavaScript enabled. The CSS solution showed promise, but is complicated by the fact that we have two CSS files that are not both used on every screen - meaning, if I use two different overlays, then half the time, one will not disappear! If I had both CSS files use the same overlay, then wouldn't it disappear when the browser was done parsing whichever file was done first?
<body>
<a class="skip" href="#MainContent">Skip Main Navigation</a>
<div id="page">
<tiles:insert attribute="header" />
<tiles:insert attribute="mainMenu" />
<a name="MainContent"></a>
<tiles:insert attribute="content" ignore="true" />
<tiles:insert attribute="footer" />
</div>
</body>