jQuery Mobile loading message

  • 440
  • 0

To hide jQuery Mobile "loading" message

[Q] 

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.

[A]

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/ andhttp://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 forshowLoadMsg 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.

shareimprove this answer

edited Feb 23 '15 at 19:04

answered May 1 '12 at 13:04

veeTrain

2,20311532

[source: stackoverflow]