Search code examples
jqueryblackberrycordova

How to display a "loading" dialog while navigating between pages?


So, my phonegap application has to work on a blackberry with OS 5. This has brought a lot of problems during the developing of the app. Initially, i had jquery-mobile, then, since blackberry cannot handle it (awful transitions, very long loading times, out of memory errors at random times) I decided to keep the logic of the app and take out jquery mobile, re-creating the interfaces in html. This worked, in fact, the app runs cleanly in BBOS 6 and android. In BB5, the app runs fine, but sometimes the loading times are a bit long.

The application was splitted into 4 different .html files, some of which contain tabs that are used to load data dinamically using ajax calls. The ajax calls work fine and take 2-4 seconds to show the content. The transition between pages, however, takes a lot of time: 15-20 seconds. What I would like to do is to display some kind of "loading..." message when navigating from one page to another so the user know that the app is working fine and it will just take some time.

Blackberry does not change the cursor image to a clock always so there's just a black page which leaves the user waiting for some time. Is there a way to notify that content is loading to the user while navigating between pages?

I know this could be done loading contents with ajax calls, but splitting the app in different pages allows me to lower the weight of the application in order for it to work on BB OS5.

Any advices on this? any help is appreciated.


Solution

  • There no standard way of doing it. but there is a way around , I did long ago.

    When a navigation link is clicked, you just open a small popup saying "Loading, Please wait" and then navigate to the clicked link. and when the target page is fully loaded, write some script to unload the popup.