jQuery Mobile Wait until next page is ready before loading

jQuery Mobile Wait until next page is ready before loading

Hi,

I've been experimenting with jQuery Mobile. I am trying to implement the following

  • When a user clicks on an events navbar along the bottom they will proceed to view a list of events.
  • This list is generated via an AJAX request from a server.
  • Currently the page loads regardless of whether the list is available or not and then subsequently displays the information once it has finished loading. Untidy!!

I would like to display the jquery mobile loading popup until the page is ready and then continue.

In the jQueryMobile Docs and Demos under 'list views' and 'list performance tests' this performs as how i would like mine to be.

I've tried binding to the 'pagebeforeshow', 'pagebeforecreate' etc. events but to no avail.

I almost need to e.preventDefault and the once the contents has been successfully loaded resume preventDefault.

Any help would be greatly appreciated.