0

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

Is it possible to automatically show default jquery-mobile ajax loader when I call $.post()

I.E. Set up some global config.

I saw this part of code in http://code.jquery.com/mobile/latest/jquery.mobile.js

(function( $, window, undefined ) {

// jQuery.mobile configurable options
$.extend( $.mobile, {

    // Show loading message during Ajax requests
    // if false, message will not appear, but loading classes will still be toggled on html el
    loadingMessage: "loading",

But I don't know how to use it.

Community
  • 1
  • 1
Yuri Kriachko
  • 294
  • 1
  • 13

1 Answers1

2

You're almost there. Your code snippet sets the relevant $.mobile object property (i.e. the message you want to display). What you also need to do is trigger the loading event itself, which you can accomplish with this call:

$.mobile.showPageLoadingMsg();
Ben
  • 7,548
  • 31
  • 45