Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Mobile loading message

When I linked jQuery Mobile to my page, some sort of loading message appeard in the bottom of the page and I can't get a rid of it. I've tried $.mobile.pageLoading(true) but it didn't work.

How should I remove it? I haven't printed it anywhere.

like image 581
MikkoP Avatar asked May 01 '12 12:05

MikkoP


2 Answers

The 1.4 loader documentation

The 1.4 documentation suggests interaction with the Loader widget. The top of the page describes globally changing the option but it can be nuanced on a link-by-link basis. This may also work:

$( document ).on( "mobileinit", function() {     $.mobile.loader.prototype.options.disabled = true; }); 

Also, according to http://demos.jquerymobile.com/1.4.5/loader/ and http://api.jquerymobile.com/loader/, you can hide the loading experience with the following code:

// As submitted by @Aras $.mobile.loading( "hide" ); // (or presumably as submitted by @Pnct) $.mobile.loading().hide(); 

Option B - disable AJAX loading

Disabling AJAX loading will effectively remove the message.

If you don't want a page to benefit from loading in the background and then showing, you can make it load like 'normal' by specifying the data-ajax='false' on whatever anchor (<a...>) tag you don't want to see a loading message for. There's also a global setting you can use to make all links load 'normally'.

To disable globally (be sure to read this page to understand implications and their recommendations. The new docs may not have warnings):

$.mobile.ajaxEnabled=false; 

Option C - just hide it

If you want to use the 1.4 Load Page approach to load external pages, it has an option available for showLoadMsg which you can simply set to false.

The global option (available in earlier versions -- at least 1.0, 1.1, and 1.2 -- read about it here) for just removing the message is:

$.mobile.loadingMessage = false; 

The 1.2 and prior documentation says that if you set it to false, no loading message will be shown.

like image 143
veeTrain Avatar answered Sep 18 '22 15:09

veeTrain


I am using the latest version of JQuery Mobile (currently 1.4) and run into this problem. None of the solutions here worked for me and I think many of them have been deprecated. Here is what worked for me:

$.mobile.loading().hide(); 

$.mobile.loading() will give you the element and you can hide it or do whatever else you wish. Hope this helps someone.

like image 42
Aras Avatar answered Sep 20 '22 15:09

Aras