I'm building jqm multipage html files using php. Each file has a "home" page and additional reference pages. The reference pages take a bit --about .2 seconds get query results returned and get "printed" in the html file by php.
There are links (ordinary anchor tags) in the home page to the reference pages. It all works fine if I wait several seconds after the home page is displayed before clicking on any of the links. However, the links on that page don't work if I don't wait. I'm assuming that the reference pages haven't finished loading. Also, if I click on one of the links before the few seconds are up, I have to refresh the browser to start again.
I think I'm looking for an easy way to hold off displaying the home page until the reference pages are completed. I have seen posts about binding js to pageloads etc, but I'm too new to grasp what they are conveying. I'm not explicitly using any js on my pages. An answer in simple language will be greatly appreciated.
I can't reproduce the problem. I probably have too fast a connection, and too slow fingers.
I would really advise against this approach, though. Multi-page documents weren't meant to be this long. Especially for mobile on a slow connection, the user will wait forever for the page to load.
And then you have to link between multi-page documents with data-rel="external", and that's neither fast nor pretty.
I do see why you do this, and admit it's a tough problem to solve. You want quick access to the reference material, but the drawback is that then you slow the delivery of chapters, and the documents are really too long to be practical in a mobile setting. Your server has to do a lot of work stitching-together references pages that may never be viewed, and then the chapter is slow to download and performs poorly when scrolling. This also impacts the transition back to the chapter pages from the reference pages.
What all this gains you is a quick transition to reference pages. Not sure it's worth it.
If you structured it all as single-page documents, you would get quick performance for home pages, and then you would be able to link between home pages without rel="external". The user would suffer some delay waiting for reference pages to be delivered from the server, though.
However, you could alleviate some of this: you could data-prefetch the reference pages. That would cause a lot of back-and-forth, though, so I would consider data-prefetching only the reference pages most likely to be used.
If your aim (or AN aim) is to eventually produce a native app, using PhoneGap, then you would certainly be better off with single-page documents.
To ease the server-side load (or to produce static pages suitable for a PhoneGap app) you could generate the entire site as static pages using a static site generator. I like Middleman, but it does take some knowledge of Ruby and ERB. You could generate the site from your existing database. Unfortunately, I don't know of any static site generators written in PHP.
What you gain by generating a static site is very low overhead - eliminating the 200mSec cost of building the chapter - as well as the possibility of using a content delivery network for even faster access. The delay to load a reference page could be made quite reasonable.
Sorry that I haven't solved your immediate problem, but perhaps I have given you some things to think about.