I am trying to adapt jquery-ui codebase to use RequireJs and I am deploying it to a much slower (but scalable) virtualized cloud service than the dedicated host that I used before.
My default pages are the ugly catastrophe of vanilla HTML. The only thing causing this mess is calls to JavaScript functions that give it the appropriate tab controls and layout. In fact, the page is laid out long and vertical ... one section after another ... before I call a function .tabs()that puts them in one block with horizontal control.
(I’m sure that I am “doing it right” in jQuery UI thinking. Without creating the entire user interface with the code to begin with, it can at least be viewed with JavaScript disabled. Although I doubt that anyone is still using Lynx , there are accessibility problems ... or make sure that your content is analyzed by search engines, I will spare you, my old man’s story about how this is an absurd way to achieve content / interface separation: - /)
When I used tags <script>to load third-party library dependencies and $(document).readyrun jQuery UI voodoo, the user never saw the vanilla ugly HTML. Now when I use RequireJs, the file is page.jsdelayed and loaded asynchronously after HTML ... waiting for libraries that are not really needed to handle DOMready. A slower server makes this look really horrible.
I could, of course, use CSS styling to hide the ugliness from the very beginning and overlay the “Loading ...” graphics until the user interface is ready. At first it came to mind, and a similar approach is suggested here:
The jQuery interface interface looks ugly to document.ready
(. , , , RequireJs, . ?)
, , ... , . "" HTML, RequireJs?