How do i load and execute JQM CSS and JS before the page has finished loading?

How do i load and execute JQM CSS and JS before the page has finished loading?

Hi 

I'm trying to use JQM, but it's not working as I want to. The nature of the service I'm using JQM for is so that it keeps adding code to the page depending on which events are triggered by the service, keeping the "connection" open for several minutes. 

I can see that the complete HTML file is loaded,but the problem seems to be that the JQM CSS and JS files are not loaded/executed before after the page has completely finished "loading". 

Here is how it looks:



I would appreciate if anybody could give me hints as to what I need to do to make the CSS and JS work while the page is loading. 

Thanks,
Michael