Haroldo
Haroldo

Reputation: 37377

jQuery Mobile - Can't access $.mobile.loading() method?

I'm trying to use jqm's loading spinner as details here: http://jquerymobile.com/test/docs/pages/loader.html

Calling $.mobile.loading('show'); or any other $.mobile.loading(...) methods from within my jqm app or from firebug console does not work.

The error message in the console is: $.mobile.loading is not a function


If i open firebug and run console.log($.mobile); i get the below object with no loading or loader methods.

enter image description here

I have also tried including the below code, but with no joy:

$( 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 = "";
});

Any help appreciated :)

Upvotes: 0

Views: 983

Answers (2)

user2231592
user2231592

Reputation:

  1. $.mobile.showPageLoadingMsg(); for show
  2. $.mobile.hidePageLoadingMsg(); for hide
  3. $.mobile.showPageLoadingMsg("a","Loading please wait..."); for show with theme and message

Upvotes: 1

davids
davids

Reputation: 6371

I would say that you are not using the last version of jQuery Mobile, and the loading method is quite new (don't know which version was released in). Try using

$.mobile.showPageLoadingMsg()

Upvotes: 1

Related Questions