14

Possible Duplicate:
Show Page Loading Spinner on Ajax Call in jQuery Mobile

have a JQuery mobile UI, how to show loading when page is not fully showed?

Community
  • 1
  • 1
user705414
  • 19,158
  • 37
  • 109
  • 154

3 Answers3

41
//show    
$.mobile.showPageLoadingMsg();

//hide
$.mobile.hidePageLoadingMsg();

http://jquerymobile.com/test/docs/api/methods.html

Homer
  • 7,386
  • 14
  • 68
  • 106
33

This API changed again in JQM 1.2. In that version $.mobile.loading('show') and $.mobile.loading('hide') should be used instead.

Tiago
  • 3,082
  • 1
  • 30
  • 45
  • 3
    This is actually the right answer. +1 – richb01 Apr 08 '13 at 15:14
  • 2
    Just looking at JQM 1.3.1 which still uses the API shown above, however it only works after the 'pagecontainercreate' event has triggered in the page lifecycle. (see jquery.mobile-1.3.1.js ln=1115) It is here that the $.mobile.loaderWidget is initialised. This is called by $.mobile.loading. (see jqm ln=973) Probably not a drama in most cases... – Rob Von Nesselrode Jun 04 '13 at 01:33
4

Docs: http://jquerymobile.com/demos/1.0a4.1/#docs/api/methods.html

$.mobile.pageLoading (method)

Show or hide the page loading message, which is configurable via $.mobile.loadingMessage. Arguments: Done (boolean, defaults to false, meaning loading has started). True will hide the loading message. Examples:

//cue the page loader           
$.mobile.pageLoading(); 

//hide the page loader          
$.mobile.pageLoading( true );
Phill Pafford
  • 80,991
  • 89
  • 259
  • 379