jQuery Mobile Docs - Page Loading Widget

# Page Loading Widget

Home Search

## The Page Loading Widget

The page loading dialog was previously configured globally with three settings `$.mobile.loadingMessage`, `$.mobile.loadingMessageTextVisible`, and `$.mobile.loadingMessageTheme` which are now deprecated. In addition to the methods for showing and hiding, `$.mobile.showPageLoadingMsg` and `$.mobile.hidePageLoadingMsg` are also deprecated.

The page loading widget handles the task of displaying the loading dialog when jQuery Mobile pulls in content via Ajax. It can also be displayed manually for custom loading actions using the `$.mobile.loading` helper method (See the global method docs).

To configure the loading dialog globally the following settings can be defined on its prototype during the `mobileinit` event.

Below are the defaults:

    $( document ).bind( 'mobileinit', function(){
      $.mobile.loader.prototype.options.text = "loading";
      $.mobile.loader.prototype.options.textVisible = false;
      $.mobile.loader.prototype.options.theme = "a";
      $.mobile.loader.prototype.options.html = "";
    });

These settings will be overridden by the deprecated settings to preserve backward compatibility. Once the deprecated settings are removed these defaults will only be superseded by the method params object described in the global method docs under `$.mobile.loading`.

    $.mobile.loading( 'show', {
    	text: 'foo',
    	textVisible: true,
    	theme: 'z',
    	html: ""
    });

## Loader examples

### More in this section

- Pages & Dialogs
- Anatomy of a page
- Single page template
- Multi-page template
- Page titles
- Linking pages
- Page transitions
- Page loading widget
- Dialogs
- Popups
- Prefetching & caching pages
- Ajax, hashes & history
- Dynamically injecting pages
- Scripting pages
- PhoneGap apps
- touchOverflow feature
- Theming pages